Maybe something like this (I am ot sure): 

CREATE TRIGGER PU_UPD_PPSTA
AFTER UPDATE OF LCR ON PPSTA 
REFERENCING OLD AS O NEW AS N
FOR EACH ROW 
MODE DB2SQL 
BEGIN ATOMIC 
 UPDATE HIST SET LCR.HIST = LCR.PPSTA 
END;

Em 13/10/2017 8:38, Paulo Roberto Leonardo Pereira escreveu: 

> I need to know how can I get examples of triggers to update a different
> table from an update on another one. 
> 
> I have a table called PPSTA which have an atribute called LCR. Another
> table called HIST has the same attribute. Also sometimes the PPSTA table
> will have a mass update to which need to replicate on HIST the same way.
> 
> What I need is: Every time that LCR were updated in PPSTA I need to
> replicate this change on HIST table using TRIGGER. 
> 
> Is there how to do this ? Please give me examples 
> 
> Thanks 
> 
> Paulo 
> 
> ----------------------------------------------------------------------
> For IBM-MAIN subscribe / signoff / archive access instructions,
> send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN

--- 

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN

Reply via email to