Re: Constraints primary and foreign key

From: Alex Heney <heneya_at_entcf3.agw.co.bt.uk>
Date: 1997/04/16
Message-ID: <33549050.51FA_at_entcf3.agw.co.bt.uk>#1/1


Camilla Straubel wrote:
>
 

> I have to update a primray key in a table. Another table has a foreign
> key to this table. What kind of statements do I use for this?
>
> Hoping for a fast answeer.

You can first DISABLE the foreign key constraint, then update the primary key, then update all records containing the old value as a foreign key, then ENABLE the constraint. Of course this does require you to have enable/disable privileges on the constraint (see your DBA if not).

-- 
The above posting represents the personal opinions of the author and
is not to be taken as official (or unofficial) policy or opinions of 
his employer.

Alex Heney, Living in the Global Village.
Received on Wed Apr 16 1997 - 00:00:00 CEST

Original text of this message