Example: Logging Errors With INSERT … SELECT - Advanced SQL Engine - Teradata Database

SQL Data Manipulation Language

Product
Advanced SQL Engine
Teradata Database
Release Number
17.00
Published
September 2020
Language
English (United States)
Last Update
2021-01-23
dita:mapPath
qtb1554762060450.ditamap
dita:ditavalPath
lze1555437562152.ditaval
dita:id
B035-1146
lifecycle
previous
Product Category
Teradata Vantage™

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 Teradata Vantage™ - SQL Data Definition Language Detailed Topics , B035-1184 .

     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;