Advertisement
ExaGridDba

set constraint deferred

Jan 23rd, 2018
148
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.66 KB | None | 0 0
  1. SQL> create table t ( n number );
  2.  
  3. Table created.
  4.  
  5. SQL> create index i on t ( n );
  6.  
  7. Index created.
  8.  
  9. SQL> alter table t add constraint p primary key ( n ) deferrable;
  10.  
  11. Table altered.
  12.  
  13. SQL> insert into t ( n ) values ( 0 );
  14.  
  15. 1 row created.
  16.  
  17. SQL> commit;
  18.  
  19. Commit complete.
  20.  
  21. SQL> insert into t ( n ) values ( 0 );
  22. insert into t ( n ) values ( 0 )
  23. *
  24. ERROR at line 1:
  25. ORA-00001: unique constraint (U.P) violated
  26.  
  27.  
  28. SQL> set constraint p deferred;
  29.  
  30. Constraint set.
  31.  
  32. SQL> insert into t ( n ) values ( 0 );
  33.  
  34. 1 row created.
  35.  
  36. SQL> commit;
  37. commit
  38. *
  39. ERROR at line 1:
  40. ORA-02091: transaction rolled back
  41. ORA-00001: unique constraint (U.P) violated
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement