I want to increment a column in a sqlite android database. Im doing like this:
public void atualiza(String word){
this.db.rawQuery("UPDATE words SET count = count + 1 WHERE word= ? ", new String[] {word});
}
And I call this method on another class like this:
this.dh.atualiza(word);
But when i pull the database from the emulator and check with the SQLite Database Browser, the field is not incremented. Why?
You should really use execSQL
for a query that does not return a table: Increase the value of a record in android/sqlite database
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With