db2 CREATE trigger --監控某個表,當數據插入到表後,執行觸發。 www.2cto.com CREATE trigger tri_ins_UB_ORGINFO after INSERT ON UB_ORGINFO --for insert REFERENCING NEW AS n FOR EACH ROW --MODE DB2SQL BEGIN ATOMIC delete from UB_ORGINFO_HK; insert into UB_ORGINFO_HK ( SELECT I_ID as ibankid, S_DISPLAYNAME as SBANKNAME,PBCBIGAREABANK as sbanktype FROM UB_ORGINFO WHERE -- BUSINESSCATEGORY !='1' AND I_STATUS=1 AND S_DN IS NULL AND PBCBIGAREABANK=276 AND PBCBIGAREABANK IS not NULL) ; end