REFERENCING Clause for Select
The REFERENCING clause for a Select trigger can declare a correlation name for the value in a column.
Element | Description | Restrictions | Syntax |
---|---|---|---|
correlation | Name that you declare here to qualify an old or new column value (as correlation.column) in a triggered action | Must be unique within this CREATE TRIGGER statement | Identifier |
This has the same syntax as the REFERENCING Clause for Delete. The scope of reference of the correlation name that you declare here is only within the FOR EACH ROW trigger action list. See Correlated Table Action.
You use the correlation name to refer to an old column value by preceding the column name with the correlation name and a period ( . ) symbol. For example, if the old correlation name is pre, you can refer to the old value for the column fname as pre.fname.
If the trigger event is a SELECT statement, using the new correlation name as a qualifier causes an error because the column does not have a new value after the column is selected. For the rules that govern the use of correlation names, see Using Correlation Names in Triggered Actions.
You can use the SELECT REFERENCING clause only if you define a FOR EACH ROW trigger action.