This is the code I'm trying to run:
open();
database.beginTransaction();
Cursor cursor = database.rawQuery("UPDATE message SET is_read=1 WHERE id = 'user1' AND (mid IN ('msg1','msg2'))",null);
if (cursor != null) {
if (cursor.moveToFirst()) {
<... success ...>
}
cursor.close();
}
database.endTransaction();
close();
And it doesn't work - the response is successful but my cursor has no updated rows.
The same query against the same database work perfectly fine in pure SQL (I'm using sqlitebrowser). What's happening here?
Aucun commentaire:
Enregistrer un commentaire