1
I got a problem when it comes to giving update
in a table on Android/SqLite
:
I tried both 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 ways is giving error, compile normally but the values are not updated in the database. I’ve debugged the application and the values are coming correctly in the method, but it just doesn’t update. When I recover the data again are without the modifications. Does anyone know what might be occurring?
in the first form, tries to make:
query = "commit;"; db.execSQL(query);
– Armando Marques Sobrinho
java.lang.Illegalstateexception: Cannot perform this Operation because there is no Current transaction.
– Diogo
returned this error there when I tried to commit
– Diogo