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: cascading update ?

Re: cascading update ?

From: Jonathan Ingram <jonathan.ingram_at_miname.com>
Date: Thu, 06 May 1999 20:48:33 GMT
Message-ID: <37320067.428C6AC4@miname.com>


Nieuws wrote:

> Is there a possibility to do a kind of cascading update of parent-child
> records ?
>
> I like to change the primary key of the parent and wanted to change
> the corresponding child records as well (primary key)

The only way that I know to do this is to use a procedure following this rough algorithim (argh, I can't ever spell that word ;):

  1. Create a copy in table Aof the table A record for which you want to change the primary key, containing the new primary key.
  2. Update all child records to point to the new primary key
  3. Delete the old primary key

Step one must be repeated for every level of parent/child relationship. So, five levels of parent-child require four steps where rows are copied to a new row.

I'm not aware of any new feature in Oracle8 or Oracle8i that would make this task any easier.

Jonathan Ingram
jonathan.ingram_at_miname.com
Remove the first "m" from "miname.com" to reply. Received on Thu May 06 1999 - 15:48:33 CDT

Original text of this message

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