To insert and configure this snippet:
Function updateRec(EGL_RecordNameNew EGL_RecordName)
//Function name - call this function passing
//the EGL_RecordName Record as a parameter
EGL_RecordNameOld EGL_RecordName; //A copy of the Record,
//used to lock the table row, and obtain the existing row values
//prior to update
try
EGL_RecordNameOld.Table_Key_column_ID
= EGL_RecordNameNew.Table_Key_column_ID;
get EGL_RecordNameOld forUpdate; //Get the existing row.
//Note that if you had custom processing to do,
//you would insert after this call
move EGL_RecordNameNew to EGL_RecordNameOld byName;
//Move the updated values to the copy-row
replace EGL_RecordNameOld; //And replace the row in the database.
sysLib.commit(); //Commit your changes to the Database
onException (ex AnyException) //If the update fails...
sysLib.rollback(); //cancel all database updates
//(assuming this is permitted by your database)
// and call a custom error handling routine or something
end
end