我試圖刪除SQLite表數據刪除數據,其中源列等於「在線」致命 - 的RuntimeException的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 –