Troubleshooting
Problem
This document discusses the history of recursion capability in trigger programs.
Resolving The Problem
For V4R4 and later releases, the IBM® DB2® UDB for iSeries Database Programming manual reports the following on trigger program usage (the specific excerpt is from the V5R1 version of the manual):
DB2 UDB for iSeries Database Programming V5R1
Commands, statements, and operations that cannot be used in trigger programs: A trigger program calls other programs or it can be nested (that is, a statement in a trigger program causes the calling of another trigger program). In addition, a trigger program can call a trigger program. The maximum trigger nested level for insert, update, delete, or read is 200. When the trigger program runs under commitment control, the following situations result in an error:
o | Any update of the same record that has already been changed by the change operation or by an operation in the trigger program. |
o | Conflicting operations on the same record within one change operation. For example, the change operation inserts a record and is then deleted by the trigger program. |
A trigger program can call other programs or can be nested (that is, a statement in a trigger program causes the calling of another trigger program). In addition, a trigger program may be called recursively by itself. The maximum trigger nested level for insert and update is 200. When the trigger program runs under commitment control, the following situations result in an error.
o | Any update of the same record that has already been changed by the change operation or by an operation in the trigger program. |
o | Produce conflicting operations on the same record within one change operation. For example, a record is inserted by the change operation and then deleted by the trigger program. |
OPM RPG | ILE RPG | OPM COBOL | ILE COBOL | ILE C | |
Program recursion allowed? | No | No (recursion allowed only for subprocedures) | No | No | Yes (recursion allowed for programs and functions) |
Historical Number
24841857
Was this topic helpful?
Document Information
Modified date:
18 December 2019
UID
nas8N1017209