Mega Code Archive

 
Categories / Oracle PLSQL Tutorial / Table
 

Add CASCADE to the end of a DISABLE CONSTRAINT clause

Add CASCADE to the end of a DISABLE CONSTRAINT clause to disable any integrity constraints that depend on the specified integrity constraint. You must use CASCADE when you disable a primary key or unique constraint that is part of a foreign key constraint. SQL> SQL> -- create demo table SQL> create table myTable(   2    id           NUMBER(2),   3    value        NUMBER(6,2)   4  )   5  / Table created. SQL> SQL> ALTER TABLE myTable   2  ADD CONSTRAINT uq UNIQUE (id) DISABLE; Table altered. SQL> SQL> ALTER TABLE myTable   2  DISABLE CONSTRAINT uq CASCADE; SQL> drop table myTable   2  / Table dropped. SQL>