Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: Deferred constraint check

Re: Deferred constraint check

From: Jonathan Lewis <jonathan_at_jlcomp.demon.co.uk>
Date: Thu, 24 Feb 2000 22:01:51 -0000
Message-ID: <951429852.14853.0.nnrp-10.9e984b29@news.demon.co.uk>


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

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US