db2 CREATE trigger
db2 CREATE trigger--监控某个表,当数据插入到表后,执行触发。www.zzzyk.comCREATE trigger tri_ins_UB_ORGINFOafter INSERT ON UB_ORGINFO--for insertREFERENCING NEW AS nFOR EACH ROW --MODE DB2SQLBEGIN ATOMICdelete from UB_ORGINFO_HK;insert into UB_ORGINFO_HK (SELECT I_ID as ibankid, S_DISPLAYNAME as SBANKNAME,PBCBIGAREABANK as sbanktypeFROM UB_ORGINFOWHERE -- BUSINESSCATEGORY !='1' ANDI_STATUS=1AND S_DN IS NULL AND PBCBIGAREABANK=276AND PBCBIGAREABANK IS not NULL) ;end