android - 编译选择时在 ","附近出现语法错误

标签 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=?    

最佳答案

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

关于android - 编译选择时在 ","附近出现语法错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22047766/

相关文章:

android - 如何以编程方式检查文件是否是android中的数据库?

java - 注册期间用于密码检查的简单正则表达式是什么?

android - fragment 中的加载器 - fragment 会泄漏吗?

java - 安卓错误 : Your app has more methods references than can fit in a single dex file

android - android字符串资源的两种访问方式

android - 如何从资源文件中获取数组的数量?

android - 使用 Application 类保存当前配置

java - Class.forName android NoClassDefFoundError -> ClassNotFoundException

android - MaterialCardView:无法在 xml 布局中设置选中状态

javascript - 如何在自定义 React Native 组件中实现按下事件