Ich versuche, eine Zeile in einer SQLite-Tabelle zu kopieren, aber ich bekomme einen Syntaxfehler:SQLite Syntaxfehler - ein Komma
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
Meine Frage wie folgt aussieht:
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);
Für mir sieht es gut aus und ich schätze, es würde ohne Kommas nicht funktionieren ...
http://stackoverflow.com/q/16838896/438992 –
Und Sie sollten auf jeden Fall Google „SQL Injection“ – Marged