Chapter 3 Building Physical Diagrams


Using referential integrity

Referential integrity is a collection of rules that govern data consistency between primary keys, alternate keys and foreign keys.

Referential integrity dictates what happens when you update or delete a value in a referenced column in the parent table, and when you delete a row containing a referenced column from the parent table.

You can implement referential integrity using one of two methods:

Referential integrity Description
Declarative Referential integrity constraints are defined for particular references. When the reference is generated the target DBMS evaluates the reference validity and generates appropriate error messages
Using triggers Referential integrity constraints are implemented by triggers based on the integrity constraints defined in the reference property sheet. The trigger evaluates reference validity and generates appropriate user-defined error messages

Note   Referential integrity as a generation option
For certain target databases you can define referential integrity as a generation option. However many databases do not accept referential integrity as a generation option (in a trigger or a declaration). In these cases, when you generate a database generation script, it does not include the definition of referential integrity.

 


Copyright (C) 2005. Sybase Inc. All rights reserved.