I want to update a value in a specific column in a specific row in my SQLite database. What type of SQLite call should I make? Can I use rawQuery() to do this or should I use the update() method. What would the call be for these?
The one I have right now is this:
ContentValues values = new ContentValues();
values.put("c_uploaded", "true");
String where = new String("WHERE c_created_at = ?");
String[] created = new String[] {"Tuesday"};
db.update("TABLE", values, where , created);
So I want to update the c_uploaded column to true where the c_created column is tuesday
Does this make sense or is there a better what to do this?
Appreciate the help.
Here is the documentation for SQLiteDatabase, and here is a good tutorial on how to use it.
As far as the answer to which method you should use, its up to you. If you have a simple update then .rawQuery() may be easiest. If there are a lot of values, then .update() would probably be easier.