5. Populating Tables : Successful Use of the Copy Statement : Error Handling with the Copy Statement : Log Errors During Copy
 
Share this page                  
Log Errors During Copy
Use the WITH LOG clause to put invalid rows into a log file for future analysis. The following query is terminated after ten errors, and these errors are placed in a log file named badrows.data:
COPY TABLE personnel 
    (name = CHAR(0), 
    dept = CHAR(0)NL) 
    FROM 'pers.data'
    WITH ERROR_COUNT = 10,
    LOG = 'badrows.data';