Connecting Tech Pros Worldwide Help | Site Map

Merging Two Triggers

Newbie
 
Join Date: Jul 2009
Posts: 2
#1: Jul 28 '09
Hi,
I have 2 triggers on a table, both triggers are updating the another table

create trigger DB.TRG1 AFTER INSERT ON Table1REFERENCING NEW AS NEW FOR EACH ROW MODE DB2SQL WHEN ( NEW.DEPT <> OLD.DEPT)CALL COBOL_SP1 (NEW.DEPT,NEW.DEPT_NO)

CREATE TRIGGER DB.TG2 AFTER INSERT ON Table1REFERENCING NEW AS NEW FOR EACH ROW MODE DB2SQL WHEN ( NEW.DEPT =222 and OLD.DEPT = 111) CALL COBOL_SP2 (NEW.DEPT,NEW.DEPT_NO);

Basically i need to merge these two triggers into one. means i need to call these two COBOL Stored Procedures in my trigger.

and i dont want to modify any of the COBOL stored Procedures. only thing i want to do is merging the above two triggers
Is it possible to CALL two Stored Procedures in a single TRIGGER?

Thanks in Advance
Ajay
debasisdas's Avatar
Moderator
 
Join Date: Dec 2006
Location: Bangalore ,India
Posts: 7,500
#2: Jul 29 '09

re: Merging Two Triggers


what is the problem ?

you just need to merge the code of both the triggers and compile as one.
Newbie
 
Join Date: Jul 2009
Posts: 2
#3: Jul 30 '09

re: Merging Two Triggers


Yes, i need to merge these two triggers and compile.
Reply