Total Pageviews

August 3, 2015

8/03/2015 08:55:00 PM
Oracle Constraints
Oracle Constraints:

DEFERRABLE CONSTRAINTS

Each constraint has two additional attributes to support deferred checking of constraints.
1 Deferred initially immediate
2 Deferred initially deferred
Deferred initially immediate checks for constraint violation at the time of insert.
Deferred initially deferred checks for constraint violation at the time of commit.

Ex:
     SQL> create table student(no number(2), name varchar(10), marks number(3),
             constraint un unique(no) deferred initially immediate);
     SQL> create table student(no number(2), name varchar(10), marks number(3),
             constraint un unique(no) deferred initially deferred);
     SQL> alter table student add constraint un unique(no) deferrable initially deferred;
 
      SQL> set constraints all immediate;
     This will enable all the constraints violations at the time of inserting.

      SQL> set constraints all deferred;
     This will enable all the constraints violations at the time of commit.

For more information on Oracle Constraints

  • Click below link
                     Oracle Constraints Basics