15.10 - OLD_NEW_TABLE - Teradata Database

Teradata Database SQL Data Definition Language Syntax and Examples

prodname
Teradata Database
vrm_release
15.10
created_date
December 2015
category
Programming Reference
featnum
B035-1144-151K

Introduction to a table correlation name for the old and new values transition table.

You can only specify an OLD_NEW_TABLE reference for an AFTER UPDATE trigger.

This clause provides two advantages for statement triggers over the NEW TABLE and OLD TABLE syntax:

  • Enables a statement trigger to store all the old and new values in a single row.
  • Eliminates the need for a self-join between the transition table and itself.
  • Enables the capability to compare the old value with its corresponding new value in the affected row rather than comparing the old value with the new values in all affected new rows.
AS old_new_table_name
Table alias name specified with the OLD_NEW_TABLE option for referencing the transition table of old and new values in the same row.
The AS keyword preceding old_new_table_name is optional.
old_value
An alias you can use to reference specific old value columns of the row in the old new table transition table.
new_value
An alias you can use to reference specific new value columns of the row in the old new table transition table.