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: SELECT '' violation
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: SELECT '' violation Example In the Travel Agency application, members of staff cannot be coaches of themselves. The following constraint takes care of this: SELECT '' violation OLD()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.
See Also Corrective Single-Record Constraints |