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: Needs help urgent..

Re: Needs help urgent..

From: Paul Dixon <paul.gp.dixon_at_bt.tinnedham.com>
Date: Tue, 17 Sep 2002 09:28:23 +0100
Message-ID: <am6pe4$5kk$1@pheidippides.axion.bt.co.uk>


"priya" <priya_at_starcomsoftware.com> wrote in message news:1ae23258.0209162213.66a85c16_at_posting.google.com...
> Hi..
>
> I want to update two tables which have ref. integrity constraints among
them.
> When I'm updating master table's primary key it gives me error as
>
> 'Integrity constraint violated .. child record found'
>
> When I'm updating detail table's ref. key gives me error as
>
> 'Integrity constraint violated.. no parent record found'
>
> Is there any way to solve above problem other than enabling / disabling
> constraints before updattion ?

Priya,

not sure why you would need to update the primary key in your master table, however there are several way to do it. A couple of examples are :-

Disable the foreign key constrant, make your changes, and then re-enable the constraint.

If you are only making minor changes then a safer option would be to leave the constraints enabled, and add a record in the master table for the new primary key value. You can then update the approriate detail table records to point to the new parent, and afterwards delete the old entry in your master table.

--
Paul Dixon
paul.gp.dixon_at_bttinnedham.com
(Remove canned meat to reply)
Received on Tue Sep 17 2002 - 03:28:23 CDT

Original text of this message

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