☰ See All Chapters |
Oracle ON DELETE CASCADE
Use the ON DELETE CASCADE option if you want rows deleted in the child table when corresponding rows are deleted in the parent table. If you do not specify cascading deletes, the default behavior of the database server prevents you from deleting data in a table if other tables reference it.
If you specify this option, when you delete a row in the parent table, the database server also deletes any rows associated with that row (foreign keys) in a child table. The advantage of the ON DELETE CASCADE option is that it allows you to reduce the quantity of SQL statements needed to perform delete actions.
Oracle ON UPDATE CASCADE
Use the ON UPDATE CASCADE option if you want rows update in the child table when corresponding rows are updated in the parent table. If you do not specify cascading updates, the default behavior of the database server prevents you from updating data in a table if other tables reference it.
All Chapters