编译select时“,”附近的语法错误

时间:2014-02-26 16:44:52

标签: android

任何人都可以在这些查询中找到错误吗?

String[] column = {"titolo","regista","cast","descrizione"};
String selection = "_id_film = ? ";
String[] selection_args = {Integer.toString(selectedfilm+1)};
Cursor cursor = db.query("T_FILM", column, selection,selection_args, null, null, null);

logcat说:

android.database.sqlite.SQLiteException: syntax error near"," (code 1) :, while compling SELECT titolo,regista,cast,descrizione FROM T_FILM WHERE _id_film=?    

1 个答案:

答案 0 :(得分:2)

“Cast”是SQLite中的保留操作。所以它试图将列名“cast”解释为一个操作。您最简单的答案是将列名更改为其他名称。