contents   index   previous   next



Cursor updateRow()

syntax:

cursor.updateRow()

return:

number - 0 if the call was successful; otherwise, a nonzero status code based on the error message produced by the database. If the method returns a nonzero status code, use the associated Database's majorErrorCode and majorErrorMessage methods to interpret the meaning of the error.

 

description:

This method uses the values in the current row of an undatable cursor to modify a row in a table. Before an updateRow can be performed, make sure the next method has been called at least once, so that the current row of the Cursor is assigned.

 

To update a row in a database table, assign values to columns in the current row of the cursor, and call updateRow. Column values that are not explicitly assigned are not changed by the updateRow method.

 

see:

#link <sedbc>, Cursor next(), Cursor previous(), Database commitTransaction(), Database rollbackTransaction()

 

example:

// assume 'database' is a valid Database object

var curs = database.table("customer");

 

// choose the first row to be updated

curs.next();

 

// update the values for the new row

curs.Paid = False;

 

// update the row in the Cursor

curs.updateRow();

database.commitTransaction();

 


Database Object