17.05 - Error Logging Tables - Teradata Database

Teradata Vantage™ - Temporal Table Support

prodname
Advanced SQL Engine
Teradata Database
vrm_release
17.00
17.05
created_date
June 2020
category
Programming Reference
featnum
B035-1182-170K

You can create an error logging table that you associate with a temporal table when you want Teradata Database to log information about update and insert errors that occur during a MERGE operation on the temporal table.

To create an error logging table, use the CREATE ERROR TABLE statement. Error logging tables are nontemporal tables. When you create an error logging table that you associate with a temporal table, the temporal columns in the temporal table are included in the error logging table as regular period data type columns.

If a valid-time column in the target table is a derived period column, the beginning and end bounds of the inserted rows are assigned to the component columns of the derived period valid-time column in the target table.

To enable error logging for a MERGE statement, specify the LOGGING ERRORS option.

For the temporal form of MERGE, the Teradata Database error logging facilities consider the following errors as local errors:
  • Sequenced duplicate rows
  • Check constraint violations
  • Errors during row build such as division by zero

Nonlocal errors are complex updates and nonsequenced USI updates. Unique constraint violations on a temporal table are join index errors instead of nonlocal errors as on a nontemporal table.

For details on how to create an error logging table, see “CREATE ERROR TABLE” in Teradata Vantage™ - SQL Data Definition Language Syntax and Examples, B035-1144. For details on how to specify error handling for the INSERT … SELECT statement, see Teradata Vantage™ - SQL Data Manipulation Language, B035-1146.