Loading

Friday, October 28, 2011

ORACLE SQL TUTORIAL: DEFERRABLE CONSTRAINTS


DEFERRABLE CONSTRAINTS

Each constraint has two additional attributes to support deferred checking of constraints.

Ø  Deferred initially immediate
Ø  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.



1 Responses to “ORACLE SQL TUTORIAL: DEFERRABLE CONSTRAINTS”

Sridevi K said...
October 8, 2016 at 1:01 AM

Regards
Sridevi Koduru (Senior Oracle Apps Trainer Oracleappstechnical.com)
LinkedIn profile - https://in.linkedin.com/in/sridevi-koduru-9b876a8b
Please Contact for One to One Online Training on Oracle Apps Technical, Financials, SCM, SQL, PL/SQL, D2K at training@oracleappstechnical.com | +91 - 9581017828.


Post a Comment

Disclaimer

The ideas, thoughts and concepts expressed here are my own. They, in no way reflect those of my employer or any other organization/client that I am associated. The articles presented doesn't imply to any particular organization or client and are meant only for knowledge Sharing purpose. The articles can't be reproduced or copied without the Owner's knowledge or permission.