Disabling a Constraint

By default, a constraint is enabled when you create it. You can initially disable a constraint by adding DISABLE to the end of the CONSTRAINT clause.


ALTER TABLE employee
ADD CONSTRAINT my_uq UNIQUE (ename) DISABLE;

You can disable an existing constraint using the DISABLE CONSTRAINT clause of ALTER TABLE. The following example disables the yourConstraintName constraint:


ALTER TABLE employee
DISABLE CONSTRAINT yourConstraintName;

CASCADE after DISABLE CONSTRAINT disables all constraints that depend on the specified constraint. CASCADE can also disable a primary key or unique constraint that is part of a foreign key constraint.

Home »
Oracle »
Table » 

Constraints:
  1. Adding a Constraint with CHECK
  2. Adding a NOT NULL Constraint
  3. Adding a FOREIGN KEY Constraint
  4. ON DELETE CASCADE
  5. ON DELETE SET NULL
  6. Adding a UNIQUE Constraint
  7. CHECK constraint
  8. Multiple Constraints
  9. Dropping a Constraint
  10. Disabling a Constraint
  11. Enabling a Constraint
  12. Deferred Constraints
  13. Getting Information on Constraints:user_constraints and all_constraints
Related: