Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Deferred constraint check
Which version of Oracle are you using ?
This works properly for me in 8.1.5
irrespective of the order of inserts.
BTW - the 2292 on my system is
'child record found' - are you copying
out your test case incorrectly ?
--
Jonathan Lewis
Yet another Oracle-related web site: http://www.jlcomp.demon.co.uk
jeanch_at_my-deja.com wrote in message <8941lh$719$1_at_nnrp1.deja.com>...
>
>To obtain deferred check at commit; you must create the constraint
>like this
>
>ALTER TABLE tab1
>ADD CONSTRAINT c_PK PRIMARY KEY (col1)
>
>ALTER TABLE tab2
>ADD CONSTRAINT c_FK FOREIGN KEY (col1)
>REFERENCE tab1(col1)
>INITIALLY DEFFERED DEFERRABLE
>
>
>then you do you're transactions and commit;
>Whatch out for this
>the order of which you execute youre transaction will
>be the order of which oracle will execute checks.
>
>for instance.
>
>insert tab2(col1)..
>insert tab1(col1)...
>commit;
>the above will not work and you'll get a ora-02292 (child not found)
>because you created the child fisrt.
>However if you do
>insert tab1(col1)...
>insert tab2(col1)...
>commit;
Received on Thu Feb 24 2000 - 16:01:51 CST
![]() |
![]() |