android - .SQLiteException: near ",": syntax error (code 1): , while compiling: -


what missing? "," seem looking in wrong place. 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 error 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 check column since check 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 +"));"; 

Comments

Popular posts from this blog

android - Get AccessToken using signpost OAuth without opening a browser (Two legged Oauth) -

org.mockito.exceptions.misusing.InvalidUseOfMatchersException: mockito -

google shop client API returns 400 bad request error while adding an item -