Oracle7 Server Application Developer's Guide

Contents Index Home Previous Next

Dropping Integrity Constraints

Drop an integrity constraint if the rule that it enforces is no longer true or if the constraint is no longer needed. Drop an integrity constraint using the ALTER TABLE command and the DROP clause. For example, the following statements drop integrity constraints:

ALTER TABLE dept  
   DROP UNIQUE (dname, loc);  
  
ALTER TABLE emp  
   DROP PRIMARY KEY,  
   DROP CONSTRAINT dept_fkey; 

DROP TABLE emp CASCADE CONSTRAINTS;

When dropping UNIQUE key, PRIMARY KEY, and FOREIGN KEY integrity constraints, you should be aware of several important issues and prerequisites. For more information about dropping FOREIGN KEY constraints, see "Managing FOREIGN KEY Integrity Constraints" [*]. UNIQUE key and PRIMARY KEY constraints are usually managed by the database administrator; see the Oracle7 Server Administrator's Guide for more information.


Contents Index Home Previous Next