gpt4 book ai didi

android - .SQLiteException : near ",": syntax error (code 1): , 编译时:

转载 作者:太空宇宙 更新时间:2023-11-03 12:34:59 26 4
gpt4 key购买 nike

我错过了什么?带有“,”的东西,但我似乎找错了地方。这是我的代码:

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 起重命名或引用 check 列.

例如:

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 +"));";

关于android - .SQLiteException : near ",": syntax error (code 1): , 编译时:,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22614049/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com