The EGL replace statement provides the fundamental "update" capability for the language. The statement writes changed record information back to a file or database. The exact behavior of the statement depends on the way you have stereotyped your record variable (see Stereotypes).
For specific considerations that apply to the replace statement when you use various data source technologies (such as SQL), see the related reference at the end of this topic.

// ask user for customer # to set key
myCustomer.customerNumber = askCustomerNo();
try
get myCustomer forUpdate;
onException(ex AnyException)
myErrorHandler(ex);
end
myCustomer.customerBalance = newBalance;
try
replace myCustomer;
onException(ex AnyException)
myErrorHandler(ex);
end