I have one column in SQLite database.It stores Text value.When new value is inserted I need to delete the previous value and add new value in Database. This is method in Class which extends SQLiteOpenHelper to update the column.
public void updateOffline(String data){
SQLiteDatabase db=this.getWritableDatabase();
String updateQuery="UPDATE "+OFFLINE_MODE +" SET "+OFFLINE_DATA+" = "+ data;
db.execSQL(readQuery);
}
where data is the String I need to UPDATE
I am calling this method in one of Fragment as
db.updateOffline(tempArray.toString());
I am getting error as
android.database.sqlite.SQLiteException: no such column: {"name":"jjajaja","phone":"4545454545","no_people":"2","booktime":"12:46 pm"} (code 1): , while compiling: UPDATE offlinedata SET offlinequeue =[{"name":"jjajaja","phone":"4545454545","no_people":"2","booktime":"12:46 pm"}]
How to resolve this ?
no such columnshows you're providing wrong column name