Académique Documents
Professionnel Documents
Culture Documents
Constraints
Attribute-based CHECK constraints
create table ( postcode number(4) check (postcode > 0) );
Schema-level ASSERTIONS
Checked at any update to the tables in the assertion. Not available in Oracle.
Assertions and triggers 2
Assertions
Syntax
create assertion name check (condition)
Has the ability to refer to all attributes in the database. Examples from Garcia-Molina
Fig. 7.6 + fig. 7.7, page 338 Example 7.14, page 339
Used to
Check the certain conditions are still true after the insert / update
Assertions and triggers 8
Instead-of triggers
executed instead of the update for updating views
which would otherwise be non-updatable Example Shah fig. 14-18, page 333 + 14-19, page 334 Full_employee_insteadOfTrigger.sql
Assertions and triggers 9