In the trigger code block, several special variables are available for use.

NEW

NEW is a pseudo-record name that references the new table row for insert and update operations in row-level triggers. This variable is not applicable in statement-level triggers or in delete operations of row-level triggers.

This variable is used in the form of :NEW.column. In :NEW.column, column is the name of a column in the table on which the trigger is defined.

The initial content of :NEW.column is the value in the named column of the new row to be inserted or of the new row that is to replace the old one when it is used in a before row-level trigger. When used in an after row-level trigger, this value has been stored in the table because the action has occurred on the affected row.

In the trigger code block, :NEW.column can be used like any other variable. If a value is assigned to :NEW.column, in the code block of a before row-level trigger, the assigned value will be used in the new inserted or updated row.

OLD

OLD is a pseudo-record name that refers to the old table row for update and delete operations in row-level triggers. This variable is not applicable in statement-level triggers or in insert operations of row-level triggers.

This variable is used in the form of :OLD.column. In :OLD.column, column is the name of a column in the table on which the trigger is defined.

The initial content of :OLD.column is the value in the named column of the row to be deleted or of the old row that is to be replaced by the new one when it is used in a before row-level trigger. When it is used in an after row-level trigger, this value is no longer stored in the table because the action has occurred on the affected row.

In the trigger code block, :OLD.column can be used like other variables. Assigning a value to :OLD.column has no impact on the action of the trigger.

INSERTING

INSERTING is a conditional expression that returns TRUE if an insert operation fires the trigger. Otherwise, it returns FALSE.

UPDATING

UPDATING is a conditional expression that returns TRUE if an update operation fires the trigger. Otherwise, it returns FALSE.

DELETING

DELETING is a conditional expression that returns TRUE if a delete operation fires the trigger. Otherwise, it returns FALSE.