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: Sybrand Bakker <postbus_at_sybrandb.demon.nl>
Date: Fri, 13 Oct 2000 07:32:29 +0200
Message-ID: <971418086.6293.0.pluto.d4ee154e@news.demon.nl>

If you are using Oracle 8 and beyond set the constraint to deferred. If you are using Oracle 7: it will be desupported in 2.5 months, so you need to upgrade anyway.

Hth,

Sybrand Bakker, Oracle DBA

"andy" <anttest30_at_hotmail.com> wrote in message news:39e5dbab$0$20911_at_wodc7nh0.news.uu.net...
> 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
>
>
Received on Fri Oct 13 2000 - 00:32:29 CDT

Original text of this message

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