Search

OPERATIONS WITH CONSTRAINTS



Possible operations with constraints as follows.

Ø  Enable
Ø  Disable
Ø  Enforce
Ø  Drop

ENABLE

This will enable the constraint. Before enable, the constraint will check the existing data.

Ex:
     SQL> alter table student12 enable constraint un;

DISABLE

This will disable the constraint.

Ex:
     SQL> alter table student12 disable constraint un;

ENFORCE

This will enforce the constraint rather than enable for future inserts or updates.
This will not check for existing data while enforcing data.

Ex:
     SQL> alter table student12 enforce constraint un;

DROP

This will remove the constraint.

Ex:
     SQL> alter table student12 drop constraint un;
     Once the table is dropped, constraints automatically will drop.