我错过了什么?带有“,”的东西,但我似乎在寻找错误的地方.这是我的代码:
private static final String DATABASE_CREATE =
"CREATE TABLE if not exists " + SQLITE_TABLE + " (" +
KEY_ROWID + " integer PRIMARY KEY autoincrement," +
KEY_CURSUS + "," +
KEY_ONDERDEEL + "," +
KEY_GAME + "," +
KEY_TIJD + "," +
KEY_WEB + "," +
KEY_CHECK + "," +
" UNIQUE (" + KEY_ROWID +"));";
这是我得到的错误:
Caused by: android.database.sqlite.SQLiteException: near ",": syntax error (code 1): , while compiling: CREATE TABLE if not exists Games_getset (_id integer PRIMARY KEY autoincrement,cursus,onderdeel,game,tijd,web,check, UNIQUE (_id));
解决方法:
自check is a keyword in SQL以来重命名或引用检查栏.
例如:
private static final String DATABASE_CREATE =
"CREATE TABLE if not exists " + SQLITE_TABLE + " (" +
KEY_ROWID + " integer PRIMARY KEY autoincrement," +
KEY_CURSUS + "," +
KEY_ONDERDEEL + "," +
KEY_GAME + "," +
KEY_TIJD + "," +
KEY_WEB + "," +
+ "`" + KEY_CHECK + "`," +
" UNIQUE (" + KEY_ROWID +"));";
【说明】:本文章由站长整理发布,文章内容不代表本站观点,如文中有侵权行为,请与本站客服联系(QQ:254677821)!