Update Rows

If a single row or multiple rows are to be updated with one or more column values in a table, updateRows() method is used.

ROWID should be set to update a row.

Ensure the following packages are imported:

Copiedimport com.zc.component.object.ZCObject
import com.zc.component.object.ZCRowObject
import com.zc.component.object.ZCTable
Copied//Create a base Object Instance
ZCObject object = ZCObject.getInstance();
//Get a Table Instance referring the table ID on base object
ZCTable table = object.getTable(1510000000110121L); 
//Create a List of RowObjects
List<ZCRowObject> rows = new ArrayList<ZCRowObject>();
//Create row instances
ZCRowObject row1 = ZCRowObject.getInstance();
ZCRowObject row2 = ZCRowObject.getInstance();
//Set the updated value on the rows referring the ROWIDs
row1.set("Name","Santhosh S");
row1.set("Age", 19);
row1.set("ROWID", 1510000000109113L);
row2.set("Name", "Santhosh Suresh");
row2.set("Age", 19);
row2.set("ROWID", 1510000000109115L);
//Add Rows to the List
rows.add(row1);
rows.add(row2);
//Update Multiple rows in table
table.updateRows(rows);