help on constraints(deferrable initially deferred,validate and novalidate)
625012May 17 2008 — edited May 17 2008SQL>create table pktab4(col1 number,col2 number);
SQL>alter table pktab4 add constraint c78 primary key(col1) deferrable initially deferred;
SQL>insert into pktab4 values(1,2);
SQL>insert into pktab4 values(2,3);
SQL>update pktab4 set col1=1 where col2=3;
SQL>alter table pktab4 enable validate primary key;
ALTER TABLE PKTAB4 ENABLE VALIDATE PRIMARY KEY
*
ERROR at line 1:
ORA-02091: transaction rolled back
ORA-00001: unique constraint (APLE47712.C78) violated
SQL>alter table pktab4 enable novalidate primary key;
Table altered.
Elapsed: 00:00:00.01
SQL>insert into pktab4 values(1,5);
1 row created.
it should not insert the data.....what i found in one book.
but it is inserting the data.
so can you plese tell me what it should do..and more importantntly what does the
deferrable initially deferred,validate and novalidate signifies
thanks