1

In update method contentvalues must store values only for field that I want to change or for every field?

ContentValues contentValues = new ContentValues();
    contentValues.put("field1", new_value);
    db.update(table, contentValues, "serial code="+serial_code,null);

or

ContentValues contentValues = new ContentValues();
    contentValues.put("field1", new_value);
    contentValues.put("field2", value2);
    contentValues.put("field3", value3);
    ...
    contentValues.put("lastfield", value99);
    db.update(table, contentValues, "serial code="+serial_code,null);

2 Answers2

0

Yes you can add only those columns value which you want to update no need to pass values for all columns for any table in SQLite Content Values.

Chetan Joshi
  • 5,582
  • 4
  • 30
  • 43
0

Just pass the column values which have changed, ,find more details here

Nayan Srivastava
  • 3,655
  • 3
  • 27
  • 49