I'm having an issue giving update
to a table in Android/SqLite
:
I tried two ways I found:
String query = "UPDATE MY_TABLE SET VALUE1='VALUE1'... WHERE KEY_ID = KEY_ID"
SQLiteDatabase db = dbHelper.getWritableDatabase();
db.execSQL(query);
ContentValues values = new ContentValues();
values.put("VALUE1",VALUE1);
.
.
.
db.update("MY_TABLE",values,"KEY_ID="+KEY_ID,null);
Neither of the two forms is giving error, compiling normally but the values are not updated in the database. I have already debugged the application and the values are arriving correctly in the method, but it just does not update. When I recover the data again are without the modifications. Does anyone know what might be happening?