【发布时间】:2015-01-21 13:59:41
【问题描述】:
错误信息:
android.database.sqlite.SQLiteException: near "transaction": syntax error (code 1): , while compiling: **create table transaction ( _id integer primary key autoincrement, amount real, type varchar(20), date integer)
我的应用程序存储由自动生成的 ID、花费的金额、付款类型和日期组成的货币交易。我的应用程序编译得很好,但是当我尝试运行创建数据库的活动时,该应用程序崩溃并显示上述消息。据我所知,我的 SQL 语句是有效的,任何人都可以就可能的原因提供任何见解吗?
Java 代码:
db.execSQL("create table transaction (" +
" _id integer primary key autoincrement, amount real, type varchar(20), date integer)");
谢谢
【问题讨论】:
-
我相信这里是重复的:stackoverflow.com/questions/6900437/… 否?
-
我删除了那部分错误,现在更清楚了,这不是那个的重复 :)
-
@Vetras 不,这不是同一个问题。
标签: java android sqlite android-sqlite