Я пытаюсь обновить базу данных SQLite после фильтрации по входным данным. ниже мой код
public void insert_checkbox(String Str1, String chkboxValue){
SQLiteDatabase db = this.getWritableDatabase();
ContentValues contentValues = new ContentValues();
contentValues.put(COLUMN_CHECKBOX, Str1 );
db.execSQL("UPDATE " + ResturantEntry.TABLE_NAME + " SET COLUMN_CHECKBOX = '" + Str1 + "' WHERE COLUMN_LOCATION = '" + chkboxValue + "'");
this.getWritableDatabase().insertOrThrow(ResturantContract.ResturantEntry.TABLE_NAME,"",contentValues);
}
}
мой код создания базы данных в моем SQLiteOpenhelper ниже
р
ublic void onCreate(SQLiteDatabase db) {
String SQL_CREATE_RESTURANTS_TABLE = "CREATE TABLE " + ResturantEntry.TABLE_NAME + "("`enter code here`
+ ResturantEntry._ID + " INTEGER PRIMARY KEY AUTOINCREMENT,"
+ ResturantEntry.COLUMN_NAME + " TEXT,"
+ ResturantEntry.COLUMN_TYPE + " TEXT,"
+ ResturantEntry.COLUMN_ADDRESS + " TEXT,"
+ ResturantEntry.COLUMN_LOCATION + " TEXT,"
+ ResturantEntry.COLUMN_GPSCOORDINATES + " INTEGER,"
+ ResturantEntry.COLUMN_TELEPHONE + " INTEGER,"
+ ResturantEntry.COLUMN_OPENINGHOURS + " INTEGER,"
+ ResturantEntry.COLUMN_CLOSINGHOURS + " INTEGER,"
+ ResturantEntry.COLUMN_CHECKBOX + " TEXT,"
+ ResturantEntry.COLUMN_CHECKBOXVALUE + " TEXT);";
db.execSQL(SQL_CREATE_RESTURANTS_TABLE);
}
я продолжаю получать сообщение об ошибке в моем logcat ниже
#################################################################
Error Code : 1 (SQLITE_ERROR)
Caused By : SQL(query) error or missing database.
(no such column: COLUMN_CHECKBOX (code 1): , while compiling: UPDATE Resturant SET COLUMN_CHECKBOX = '1' WHERE COLUMN_LOCATION = 'Ajah')
#################################################################