【发布时间】:2016-04-25 09:47:15
【问题描述】:
我正在尝试从源列等于“在线”的 SQLite 表中删除数据
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.reminders/com.reminders.FetchDataActivity}: android.database.sqlite.SQLiteException: no such column: Online (code 1): , while compiling: delete from ReminderTable where source = Online
这是我的代码:
public void deleteOnlineReminders() {
SQLiteDatabase db = this.getReadableDatabase();
db.execSQL("delete from "+ TABLE_REMINDERS + " where " + KEY_SOURCE + " = " + "Online");
}
Or 是不是因为我没有任何数据到列源=在线的表中
【问题讨论】:
-
在执行此操作之前,只需检查表是否已创建,异常似乎没有名为 KEY_SOURCE 的列
标签: android sqlite where-clause runtimeexception