Enabling a Constraint

You can enable an existing constraint using the ENABLE CONSTRAINT clause of ALTER TABLE.


ALTER TABLE employee
ENABLE CONSTRAINT your_constraint_name;

To enable a constraint, all the rows in the table must satisfy the constraint. You can apply a constraint to new data only by specifying ENABLE NOVALIDATE:


ALTER TABLE employee
ENABLE NOVALIDATE CONSTRAINT your_constraint_name;

The default is ENABLE VALIDATE, which means existing rows must pass the constraint check.

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: