Using Correlation Names in Triggered Actions

These rules apply when you use correlation names in triggered actions:
  • You can use the correlation names as qualifiers for the old and new column values in SQL statements of the FOR EACH ROW triggered-action list and in the WHEN condition.
  • The WHEN conditions and FOR EACH ROW clauses of multiple triggers on the same table can use different correlated variables in the REFERENCING clauses of triggers and of trigger routines to reference values in the same column.
  • The old and new correlation names refer to all rows affected by the triggering statement.
  • You cannot use the correlation name to qualify a column name in the GROUP BY, the SET, or the COUNT DISTINCT clause.
  • The scope of reference of the correlation names is the entire trigger definition. This scope is statically determined, meaning that it is limited to the trigger definition; it does not encompass cascading triggers or columns that are qualified by a table name in a UDR that is a triggered action, except for trigger routines that are invoked in the FOR EACH ROW clause.

For additional information on using correlation names in trigger routines, see Rules for SPL Routines.