When Oracle Drop Table of Cascade Constraints

When Oracle Drop Table of Cascade Constraints

When using Oracle Drop statements, such as:

drop table CUSTOMER_INFO cascade constraints;

When you delete a primary key constraint:

  • Use the keyword cascade, you can delete those using foreign keys and reference the column on delete cascade to cascade delete key reference data for that keyword.

  • Use delete cascade constraint constraint in the delete column at the same time. E.g. primary key constraint like.

  • Use Drop table table_a cascade constraints can delete the associated table table_a of constraint to achieve the purpose of your drop table table_a, originally belonging to the table table_b the foreign key constraint has followed is deleted, but stored in the data table table_b can not be delete, that is to say Drop table cascade constraints is without prejudice to the row data stored in the objec inside.

In general, for those in the delete column constraints include multiple columns, we must use cascade constraint keywords, otherwise it is not necessary, although the use is not wrong.

Published 348 original articles · won praise 1746 · Views 1.91 million +

Guess you like

Origin blog.csdn.net/qq_40147863/article/details/96764741