7.7 SQL*Loader Discarded and Rejected Records
SQL*Loader can reject or discard some records read from the input file, either because of issues with the files, or because you have selected to filter the records out of the load.
Rejected records are placed in a bad file, and discarded records are placed in a discard file.
- The SQL*Loader Bad File
The bad file contains records that were rejected, either by SQL*Loader or by Oracle Database. - The SQL*Loader Discard File
As SQL*Loader runs, it can filter some records out of the load, and create a file called the discard file.
Parent topic: Understanding How to Use SQL*Loader
7.7.1 The SQL*Loader Bad File
The bad file contains records that were rejected, either by SQL*Loader or by Oracle Database.
If you do not specify a bad file, and there are rejected records, then SQL*Loader
automatically creates one. A rejected record has the same name as the data file, with a
.bad
extension. There can be several causes for rejections.
- Records Rejected by SQL*Loader
Data file records are rejected by SQL*Loader when the input format is invalid. - Records Rejected by Oracle Database During a SQL*Loader Operation
After a data file record is accepted for processing by SQL*Loader, it is sent to the database for insertion into a table as a row.
Parent topic: SQL*Loader Discarded and Rejected Records
7.7.1.1 Records Rejected by SQL*Loader
Data file records are rejected by SQL*Loader when the input format is invalid.
For example, if the second enclosure delimiter is missing, or if a delimited field exceeds its maximum length, then SQL*Loader rejects the record. Rejected records are placed in the bad file.
Parent topic: The SQL*Loader Bad File
7.7.1.2 Records Rejected by Oracle Database During a SQL*Loader Operation
After a data file record is accepted for processing by SQL*Loader, it is sent to the database for insertion into a table as a row.
If the database determines that the row is valid, then the row is inserted into the table. If the row is determined to be invalid, then the record is rejected and SQL*Loader puts it in the bad file. The row may be invalid, for example, because a key is not unique, because a required field is null, or because the field contains invalid data for the Oracle data type.
Parent topic: The SQL*Loader Bad File
7.7.2 The SQL*Loader Discard File
As SQL*Loader runs, it can filter some records out of the load, and create a file called the discard file.
A discard file is created only when it is needed, and only if you have specified that a discard file should be enabled. The discard file contains records that were filtered out of the load because they did not match any record-selection criteria specified in the control file.
Because the discard file contains record filtered out of the load, the contents of the discard file are records that were not inserted into any table in the database. You can specify the maximum number of such records that the discard file can accept. Data written to any database table is not written to the discard file.
Parent topic: SQL*Loader Discarded and Rejected Records