I try to increase the value of an integer key in a row in my table. However, nothing really seems to happen.
db.rawQuery(\"UPDATE table SET key = key + 1 WH
From http://developer.android.com/reference/android/database/sqlite/SQLiteDatabase.html:
public Cursor rawQuery (String sql, String[] selectionArgs)
Runs the provided SQL and returns a Cursor over the result set. Returns a Cursor object, which is positioned before the first entry
compared to:
public void execSQL (String sql, Object[] bindArgs)
Execute a single SQL statement that is not a query. For example, CREATE TABLE
, DELETE
, INSERT
, etc.
In other words, SQL queries which return a table are to be run with rawQuery
, and those that do not return tables are to be run with execSQL
.