We are developing a DB2 V7 z/OS application which uses a "trigger"
table containing numerous triggers - each of which is activated by an
UPDATE to a different column of this "trigger" table. When the
triggers are fired, various other operations are performed on other
tables in the database. The triggers are not created on these other
tables because other programs perform updates to these tables and we
do not want the triggers to fire for them. There is no trigger
cascading.
The problem appears to be that, even though different columns control
the trigger activation, any UPDATE to the "trigger" table causes
trigger execution to proceed in the order of trigger creation. For
example:
CREATE TRIGGER Trigger 1
AFTER UPDATE OF AA
ON TFP_TRIGGERS
CREATE TRIGGER Trigger 2
AFTER UPDATE OF BB
ON TFP_TRIGGERS
Although AA and BB are updated independently, Trigger 2 (newer
timestamp) waits until Trigger 1 has completed. So even though the
triggers seem to have different triggering events, DB2 appears to be
treating both triggers as having the same triggering event. Is there
any way to have trigger activation controlled at the column level so
that both triggers can be activated independently and run
simultaneously?