Managing Referential Integrity

Referential Integrity enables definition of the relationship between a primary key in one table and a key in another table, called the foreign key. The foreign key must match the primary key's type and length exactly. Also, if a concatenation is used, the order of columns concatenated must be the same. The column names do not have to be the same.
carcudb2
Referential Integrity enables definition of the relationship between a primary key in one table and a key in another table, called the foreign key. The foreign key must match the primary key's type and length exactly. Also, if a concatenation is used, the order of columns concatenated must be the same. The column names do not have to be the same.
Defining the relationship between two tables using primary and foreign keys is called making referential rules. Referential rules help ensure referential integrity. Once the relationship between the keys has been defined, DB2 will help ensure that changes to data are consistent between parent and child tables. (The table whose primary key is being used for reference is called the parent table. The table that calls upon this reference through a foreign key is called the child Table. The parent and child are not necessarily different.) The referential integrity option permits assignment of primary and foreign keys and to define the relationship between the data in those keys.