How to increase field in android sqlite database

I want to increase the column in android sqlite database. Im doing so:

public void atualiza(String word){
   this.db.rawQuery("UPDATE words SET count = count + 1 WHERE word= ? ", new String[] {word});     
}

And I call this method in another class as follows:

this.dh.atualiza(word); 

But when I pull the database out of the emulator and check with SQLite Database Browser, this field does not increase. Why?

+5
source share
2 answers

You really should use execSQLfor a query that does not return a table: Increment the value of the entry in the android / sqlite database

+4
source

You need to start a transaction in the database. Data not inserted into the Sqlite database in android

0

All Articles