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.
Note: ROWDID should be set to update a row.
Ensure the following packages are imported:
copy
import com.zc.component.object.ZCObject;
import com.zc.component.object.ZCRowObject;
import com.zc.component.object.ZCTable;
copy
//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); // replace table ID
//Create a List of RowObjects
List rows = new ArrayList();
//Create row instances
ZCRowObject row1 = ZCRowObject.getInstance();
ZCRowObject row2 = ZCRowObject.getInstance();
//Set the updated value on the rows referring the ROWIDs
row1.set("Name","Amelia S");
row1.set("Age", 19);
row1.set("ROWID", 1510000000109113L); // replace row id
row2.set("Name", "Walker Don");
row2.set("Age", 19);
row2.set("ROWID", 1510000000109115L); // replace row id
//Add Rows to the List
rows.add(row1);
rows.add(row2);
//Update Multiple rows in table
table.updateRows(rows);
Last Updated 2023-09-03 01:06:41 +0530 +0530
Yes
No
Send your feedback to us
Skip
Submit