|
-
Hi ,
How it works:
Create table a ( a number);
alter table a add constraint gpu unique (a) deferrable initially deferred; -- Note this statement
alter table a disable constraint gpu ;
insert into a values (1);
insert into a values (1);
commit;
alter table a enable novalidate constraint gpu;
sql> table altered
sql>
select * from a;
A
-----
1
1
SQL> insert into a values (1);
1 row created.
SQL> commit;
commit
*
ERROR at line 1:
ORA-02091: transaction rolled back
ORA-00001: unique constraint (SYSTEM.GPU) violated
So the constraint has to be created as deferrable .
thanks
GP
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|