3 Top DB2 Referential Integrity Rules

The story about referential integrity in DB2 database. Given the most popular points on referential integrity.

  1. When inserting foreign key row it disallows when there is no corresponding Primary key.
  2. New primary key row can be inserted as long as it is unique
  3. When updating foreign key value, it checks if corresponding primary key is available
  4. If a primary key has dependent foreign key Db2 does not allow to update. we can make by setting foreign key to zeros or we can delete all foreign key values.
  5. Deleting a row of foreign key is permitted.
  6. When deleting primary key: The below are the constraints: CASCADE, RESTRICT, SET NULL, NO ACTION

Related Posts

Author: Srini

Experienced software developer. Skills in Development, Coding, Testing and Debugging. Good Data analytic skills (Data Warehousing and BI). Also skills in Mainframe.