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

Home -> Community -> Usenet -> c.d.o.misc -> Re: Cascading triggers

Re: Cascading triggers

From: Thomas Kyte <tkyte_at_us.oracle.com>
Date: Sat, 30 Jan 1999 01:28:21 GMT
Message-ID: <36b25f9f.1275273@192.86.155.100>


A copy of this was sent to jbaker_at_powertrade.com (if that email address didn't require changing) On Fri, 29 Jan 1999 22:58:28 GMT, you wrote:

>I have table A on which I have an a_aiud_row trigger that contains an update
>statement for table B. Table B has b_aiud_row to update table C. My
>question: Is there any way in b_aiud_row to access a value from the updated
>row in table A? Obviously, I can access both the :NEW. and :OLD values from
>table B (as it is a ROW level trigger on table B), but I need a value from
>table A.
>
>Any ideas?

you could use a package for this, for example:

create package pkg_a
as

    g_some_column a.some_column%type;     g_some_other_column a.some_other_column%type; end;

create trigger a_trigger
after update or update or delete on A
for each row
begin

    pkg_a.g_some_column := :new.some_column;     pkg_a.g_some_other_column := :new.some_other_column;

    update b set ....;
end;

the trigger on b can access the package...

>
>Thanks in advance
>
>Jim
>
>-----------== Posted via Deja News, The Discussion Network ==----------
>http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
 

Thomas Kyte
tkyte_at_us.oracle.com
Oracle Service Industries
Reston, VA USA

--
http://govt.us.oracle.com/ -- downloadable utilities  



Opinions are mine and do not necessarily reflect those of Oracle Corporation  

Anti-Anti Spam Msg: if you want an answer emailed to you, you have to make it easy to get email to you. Any bounced email will be treated the same way i treat SPAM-- I delete it. Received on Fri Jan 29 1999 - 19:28:21 CST

Original text of this message

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