Oracle7 Server Utilities

Contents Index Home Previous Next

Specifying the Bad File

When SQL*Loader executes, it may create a file called a bad file or reject file where it places records that were rejected because of formatting errors or because they caused Oracle errors. The bad file is created according to the following rules:

Suggestion: If a file exists with the same name as the bad file that SQL*Loader may create, delete or rename it before running SQL*Loader.

Additional Information: On some systems a new version of the file is created if a file with the same name already exists. See your Oracle operating system-specific documentation to find out if this is the case on your system.

To specify the name of this file, use the BADFILE or BADDN keyword, followed by the filename. If you do not specify a name for the bad file, the name defaults to the name of the datafile with an extension or file type of BAD. You can also specify the bad file from the command line with the BAD parameter described [*].

A filename specified on the command line is associated with the first INFILE or INDDN clause in the control file, overriding any bad file that may have been specified as part of that clause.

The bad file is created in the same record and file format as the datafile so that the data can be reloaded after corrections. The syntax is

where:

BADFILE or BADDN Either keyword may be used.
bad_file_name Any valid file specification, naming a file to receive rejected records.
Note: Filenames that include spaces or punctuation marks should be enclosed in single quotation marks. For more details on filename specification, see "Specifying Filenames and Database Objects" [*].

Examples of How to Specify a Bad File

In the following example, you specify a bad file with filename UGH and default file extension or file type of BAD:

BADFILE UGH 

In the next examples, you specify a bad file with filename BAD0001 and file extension or file type of REJ:

BADDN BAD0001.REJ 
BADDN '/REJECT_DIR/BAD0001.REJ' 


Contents Index Home Previous Next