BAD

Default: The default depends on whether any data file(s) are specified (using the DATA parameter). See "Default Values Used by SQL*Loader Express Mode".

Purpose

The BAD parameter specifies the location and name of the bad file.

Syntax and Description

BAD=[directory/][filename]

The bad file stores records that cause errors during insert or that are improperly formatted. If you specify the BAD parameter, you must supply either a directory or file name, or both. If you do not specify the BAD parameter, and there are rejected records, then the default file name is used.

The directory variable specifies a directory to which the bad file is written. The specification can include the name of a device or a network node.

The filename variable specifies a file name recognized as valid on your platform. You must specify only a name (and extension, if one other than .bad is desired). Any spaces or punctuation marks in the file name must be enclosed in single quotation marks.

The values of directory and filename are determined as follows:

  • If the BAD parameter is specified with a file name but no directory, then the directory defaults to the current directory.

  • If the BAD parameter is specified with a directory but no file name, then the specified directory is used and the default is used for the file name and the extension.

The BAD parameter applies to all the files which match the specified DATA parameter (if it is specified). It applies to the one data file (table-name.dat) if the data parameter is not specified.

Restrictions

Caution:

  • If the file name (either the default or one you specify) already exists, then it is either overwritten or a new version is created, depending on your operating system.

  • If multiple data files are being loaded, then it is recommended that you either not specify the BAD parameter or that you specify it with only a directory for the bad file.

Example

The following specification creates a bad file named emp1.bad in the current directory:

> sqlldr hr TABLE=employees BAD=emp1