SchemaUpdateRule Object

Update Rules in Data Abstract let you define the order in which to process updates for data tables. By default, if no update rules are defined, the server will apply the updates in the order they were received, but if update rules are defined, they define the order in which updates are processed.

For example: it's possible to first process all Inserts on Customers, then all Inserts on CustomerDetails, then all Updates on CustomerDetails, all Updates on Customers, and last of all the Deletes on CustomerDetails, and Deletes on Customers, so the referential integrity isn't broken while updating. These update rules can be accessed through the Global Object's schema variable's updateRules property.

The code snippet below shows how the updateRules object can be used:

for (i=0; i<schema.updateRules.count; i++)
{
  log('schema.updateRules['+i+'].name ='+schema.updateRules[i].name);
  log('schema.updateRules['+i+'].dataTableName ='+schema.updateRules[i].dataTableName);
  log('schema.updateRules['+i+'].doDelete ='+schema.updateRules[i].doDelete);
  log('schema.updateRules['+i+'].doInsert ='+schema.updateRules[i].doInsert);
  log('schema.updateRules['+i+'].doUpdate ='+schema.updateRules[i].doUpdate);
  log('schema.updateRules['+i+'].failureBehavior ='+schema.updateRules[i].failureBehavior);
}

Properties

name

Represents the name of the update rule, this is the name this object can be uniquely identified with.

description

Represents the description for this update rule.

dataTableName

Represents the name of the data table this rule is associated with.

doDelete

Triggers this update rule for deletions.

doInsert

Triggers this update rule for inserts.

doUpdate

Triggers this update rule for updates.

failureBehavior

Represents failure behavior. Valid values are:

  • RaiseException
  • LogAndContinue
  • IgnoreAndContinue