When a trigger is created, DB2 creates a trigger package for the statements in the triggered action. The trigger package is recorded in SYSIBM.SYSPACKAGE and has the same name as the trigger.
Before a trigger is created, it is good practice to ensure that there are no packages with the same name as the trigger being created.
When the Trigger is Activated
The trigger package is always accessible and can be executed only when a trigger is activated by a triggering operation.
“By default, when a trigger is created, the trigger package is bound by DB2 with EXPLAIN set to NO.“
Trigger packages are recorded in the SYIBM.SYSPACKDEP table with column DTYPE set to “T”.
When the trigger is first created, you will not have the access paths for the SQL statements in the trigger.
However, you can immediately rebind the trigger package specifying EXPLAIN YES to obtain access paths. To rebind the trigger package, issue the REBIND TRIGGER PACKAGE command.
To delete the trigger package, you must use the DROP TRIGGER statement.
You must be logged in to post a comment.