The delete rule for referential constraints

The delete rule controls how the delete operations are performed against a parent table participating in a referential integrity constraint. The four possible behaviors with a delete rule are as follows:

  • ON DELETE CASCADE: This ensures that whenever a record from the parent table of a referential integrity constraint is deleted, all dependent records in the child table that have matching primary key values in their foreign key are deleted as well.
  • ON DELETE SET NULL: This ensures that whenever a record from the parent table of a referential integrity constraint is deleted, all the dependent records in the child table that have matching primary key values in their foreign key are set to NULL. For ...

Get IBM Db2 11.1 Certification Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.