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: triggers

Re: triggers

From: Thomas Kyte <tkyte_at_us.oracle.com>
Date: Thu, 24 Dec 1998 22:43:36 GMT
Message-ID: <3684c35b.10769976@192.86.155.100>


A copy of this was sent to stormbgr_at_dbstech.com (Stormbringer) (if that email address didn't require changing) On Thu, 24 Dec 1998 19:23:21 GMT, you wrote:

>how do I set up a trigger to work on specific rows in another table.
>OK, this is what I mean.
>
>table1
>did <-primary key
>
>table2
>did <-primary key
>
>row trigger is set up on table1. when the triger fires I want the code to
>just alter table2's stuff where table1.did (from the triger) = table2.did.
>
>
>Derek

create trigger your_trigger
after update on table1
for each row
begin

    update table2 set .... = ....

     where table2.did = :new.did;
                   /*   ^^^^^^^^^ table1.did */
end;  

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 Thu Dec 24 1998 - 16:43:36 CST

Original text of this message

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