I'm trying to copy a row in a SQLite table, but I get a syntax error:
android.database.sqlite.SQLiteException: near ",": syntax error (code 1): , while compiling: INSERT INTO tokens(colour, power, ts) SELECT (colour, power, ts) FROM tokens WHERE _id = 1
My query looks like this:
db.execSQL("INSERT INTO " + TABLE_TOKENS + "(" + COLUMN_COLOUR + ", " + COLUMN_POWER + ", " + COLUMN_TS + ")" +
" SELECT (" + COLUMN_COLOUR + ", " + COLUMN_POWER + ", " + COLUMN_TS + ")" +
" FROM " + TABLE_TOKENS +
" WHERE _id = " + id);
For me it looks fine and I guess it wouldn't work without commas...