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

Home -> Community -> Usenet -> c.d.o.server -> Re: change foreign key value????

Re: change foreign key value????

From: Tim Hentzel <thentzel_at_silicon-age.com>
Date: Thu, 12 Oct 2000 17:11:56 GMT
Message-ID: <8s4rcl$ocr$1@nnrp1.deja.com>

cascading updates will allow you to do this.

hth,
tim hentzel

http://www.codegarden.com

In article <39e5dbab$0$20911_at_wodc7nh0.news.uu.net>,   "andy" <anttest30_at_hotmail.com> wrote:
> I have two tables: MASTER and DETAIL.
>
> Master.INV_NO is the primary key
>
> Detail has a fk constraint on INV_NO.
>
> I want to create a utility to change an invoice number.
>
> If I write
>
> begin
> Update Master set INV_NO = 2 where INV_NO = 1;
> Update Detail set INV_NO = 2 where INV_NO = 1;
> Commit;
> end;
>
> it fails because the constraint is violated temporarily.
>
> Is there anyway to easily temporarily disable the FK constraint
 during a
> transaction. (i.e. disable until commit is called)??
>
> thanks,
>
> andy
>
>

Sent via Deja.com http://www.deja.com/
Before you buy. Received on Thu Oct 12 2000 - 12:11:56 CDT

Original text of this message

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