Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Deferred constraint check
In article <951429852.14853.0.nnrp-10.9e984b29_at_news.demon.co.uk>,
"Jonathan Lewis" <jonathan_at_jlcomp.demon.co.uk> wrote:
> Which version of Oracle are you using ?
The behavior I described is on 8.0.4 version.
I just wasn't expected this kind of behavior at all:(
I suddenly had to change my code to comply with the
order oracle expects. :(
> 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
you're right 'child record not found'
> 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;
>
>
Sent via Deja.com http://www.deja.com/
Before you buy.
Received on Fri Feb 25 2000 - 03:09:09 CST
![]() |
![]() |