Restrictive single-record constraints
A restrictive single-record constraint is a SELECT... FROM... WHERE... statement that selects the data that is not supposed to be in your database. The SELECT clause must be no longer than:
The alias ("violated") is optional. The Rules Engine ignores any other information in the SELECT clause.
The syntax of a restrictive single-record constraint is:
In the Travel Agency application, members of staff cannot be coaches of themselves. The following constraint takes care of this:
You can use the OLD() function, or you can set transition properties for the constraint, or both, in which case you turn the constraint into a transitional constraint.