Home Page for the TeradataForum
 
https:

Archives of the TeradataForum

Message Posted: Fri, 20 Sep 2002 @ 16:37:57 GMT


     
  <Prev Next>   <<First <Prev Next> Last>>  


Subj:   Re: Update Trigger
 
From:   Street, John

the syntax should be something like this below and will help you out I think. I am assuming that you only want to update the target table once for the update not for each row changed, so I have used the STATEMENT trigger construct

Sometimes its an insert for the audit trail you are trying to do, really depends on what your trying to achieve by this as to what the trigger should look like

this is an example of an update

create TRIGGER admin.StageUpd
after UPDATE ON financial.checking_tran
FOR EACH STATEMENT
(update admin.ProdTabStage
set username = 'updated1' , upddate = date+1
;)

this is an example of an insert:

create TRIGGER admin.StageUpd
after UPDATE ON financial.checking_tran
FOR EACH STATEMENT
(INSERT admin.ProdTabStage
values ( 'UPDATED', date);)


Cheers

John Street
Senior Principal Consultant,
Relationship Technology Solutions for Financial Services,
NCR Limited



     
  <Prev Next>   <<First <Prev Next> Last>>  
 
 
 
 
 
 
 
 
  
  Top Home Privacy Feedback  
 
 
Copyright for the TeradataForum (TDATA-L), Manta BlueSky    
Copyright 2016 - All Rights Reserved    
Last Modified: 28 Jun 2020