FOR EACH ROW / FOR EACH STATEMENT TRIGGER Conditions

Document ID : KB000012558
Last Modified Date : 14/02/2018
Show Technical Document Details
Question:

Where in the Repository are the Trigger conditions FOR EACH ROW / FOR EACH STATEMENT STORED?  We use the Repository to generate DB2 DDL and we need to change the condition in the repository so that the corresponding DDL contains the correct condition. 

Answer:

The trigger condition is stored on the TRIGGER entity type in the DB2 dialog. The DB2 DDL generation program checks the TRIGGERING TYPE column for the presence of the ROW keyword.  

If found, then FOR EACH ROW is generated.  If ROW is omitted then FOR EACH STATEMENT is generated. 

For example

TRIGGER TYPE           ===> AFTER ROW

Results in 'FOR EACH ROW' being generated.