Example: Logging Errors With INSERT … SELECT - Teradata Database

SQL Data Manipulation Language

Product
Teradata Database
Release Number
15.10
Language
English (United States)
Last Update
2018-10-06
dita:id
B035-1146
lifecycle
previous
Product Category
Teradata® Database

Example: Logging Errors With INSERT … SELECT

The following examples show various types of error logging with INSERT … SELECT requests:

The following request logs all data, referential integrity, and USI errors to the default limit of 10 errors.

     INSERT INTO t 
     SELECT * 
     FROM s 
     LOGGING ERRORS;

The following request logs all data, referential integrity, and USI errors to the default limit of 10 errors.

     INSERT INTO t 
     SELECT * 
     FROM s 
     LOGGING ALL ERRORS;

The following request logs data, referential integrity, and USI errors with no error limit. This does not mean that there is no limit on the number of errors the system can log; instead, it means that errors will continue to be logged until the system‑determined limit of 16,000,000 have been logged. See “CREATE ERROR TABLE” in SQL Data Definition Language.

     INSERT INTO t 
     SELECT * 
     FROM s 
     LOGGING ERRORS WITH NO LIMIT;

The following request logs data row, referential integrity, and USI errors to a limit of 100 errors.

     INSERT INTO t 
     SELECT * 
     FROM s 
     LOGGING ERRORS WITH LIMIT OF 100;