What am I missing? Something with a "," but I seem to be looking in the wrong place. This is my code:
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 +"));";
And this is the error I get:
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));
Rename or quote the check column since check is a keyword in SQL.
For example:
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 +"));";
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With