Re: Help Update Cascade
Date: Wed, 22 Sep 1999 11:37:49 -0400
Message-ID: <BPfoNyGYDL2Ew4DJHFfU1a+amDH+_at_4ax.com>
A copy of this was sent to "Gracy" <gracy.girardi_at_arts.monash.edu.au> (if that email address didn't require changing) On Wed, 22 Sep 1999 18:42:49 +1000, you wrote:
>Hi.
>
>I am new to this , have an assignment due in tomorrow and simply cannot work
>out how to create a trigger with an update cascade, to automatically change,
>delete or insert info in a table with an associated foreign key, when I make
>changes to a table with foreign key constraints. Any help very welcome.
>Sorry if this seems very simple to you experts.
>
>Gracy
>
Actually -- its not very simple at all and is quite advanced. Normally -- i don't follow up posts that look like they might be homework ("an assignment due") but given that this question typically stumps Oracle developers with lots of experience -- I'll help out.
If you have the foreign key constraints -- it is very difficult to do an update cascade with triggers, even in Oracle8.0 and up where we have deferred constraints. That is because of mutating table errors.
To see an implemetation of update cascade that works with versions 7.1 and up -- see the URL in my signature below. I have some packages that generate the triggers you need to do update cascade. They should get you going.
-- See http://govt.us.oracle.com/~tkyte/ for my columns 'Digging-in to Oracle8i'... Current article is "Part I of V, Autonomous Transactions" updated June 21'st Thomas Kyte tkyte_at_us.oracle.com Oracle Service Industries Reston, VA USA [Quoted] Opinions are mine and do not necessarily reflect those of Oracle CorporationReceived on Wed Sep 22 1999 - 17:37:49 CEST