Total Pageviews

August 4, 2015

8/04/2015 09:25:00 AM
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



 
Related Posts Plugin for WordPress, Blogger...