Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Cascading triggers
You can create a small table for storing the primary key of the records being
updated.
An after statement trigger can be used to run queries using this data and then
delete it all when finished.
Thomas Kyte wrote:
> 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 Sun Jan 31 1999 - 19:38:25 CST
![]() |
![]() |