CREATE/REPLACE TRIGGER Syntax | Teradata Vantage - 17.10 - CREATE TRIGGER and REPLACE TRIGGER Syntax - Advanced SQL Engine - Teradata Database

Teradata Vantage™ - SQL Data Definition Language Syntax and Examples

Product
Advanced SQL Engine
Teradata Database
Release Number
17.10
Release Date
July 2021
Content Type
Programming Reference
Publication ID
B035-1144-171K
Language
English (United States)
{ CREATE | REPLACE } TRIGGER [ database_name_1. ] trigger_name
  [ ENABLED | DISABLED ]
  { BEFORE | AFTER } [ temporal_option ] triggering_event
  ON [ database_name_2. ] table_name
  [ ORDER integer ]
  REFERENCING reference [...]
  [ FOR EACH { ROW | STATEMENT } ]
  [ WHEN ( search_condition ) ]
  { trigger_action | BEGIN ATOMIC trigger_action END } [;]
triggering_event
{ INSERT | 
  DELETE |
  UPDATE [ OF { column_name [,...] | ( column_name [,...] ) } ]
}
reference
{ OLD [ ROW ] [AS] old_transition_variable_name |
  NEW [ ROW ] [AS] new_transition_variable_name |
  { OLD_TABLE | OLD TABLE } [AS] old_transition_table_name |
  { NEW_TABLE | NEW TABLE } [AS] new_transition_table_name |
  OLD_NEW_TABLE [AS] old_new_table_name ( old_value, new_value )
}
trigger_action
{ SQL_procedure_statement [;...] |
  ( SQL_procedure_statement [;...] )
}