「断片」ビューの EGL ドロワー内の databaseUpdate 断片は、PageHandler からレコードを渡したときに、リレーショナル・テーブルの単一行を更新する関数です。 この断片は、EGL ライブラリーに置かれるよう意図されたものです。 この断片を挿入し構成する手順は、次のとおりです。
Function updateRec(${TableName}New ${TableName})
// Function name - call this function
// passing the ${TableName} Record as a parameter
${TableName}Old ${TableName};
// A copy of the Record, used
// to lock the table row and to obtain
// the existing row values prior to update try
${TableName}Old.${KeyColumn} =
${TableName}New.${KeyColumn};
get ${TableName}Old forUpdate;
// Get the existing row.
// Note that if you had custom processing to do,
// you would insert your code after this call
move ${TableName}New to ${TableName}Old byName;
//Move the updated values to the copy-row
replace ${TableName}Old;
//And replace the row in the database.
sysLib.commit();
//Commit your changes to the Database
onException
//If the update fails...
sysLib.rollback();
// cancel all database updates
// (assuming this is permitted
// by your database) and call
// a custom error handling routine
end
end