This clause is used to specify the name of an output file (BADFILE
, DISCARDFILE,
or LOGFILE
). You must supply either a directory object name or file name, or both. The directory object name is the name of a directory object where the user accessing the external table has privileges to write. If the directory object name is omitted, then the value specified for the DEFAULT
DIRECTORY
clause in the CREATE
TABLE...
ORGANIZATION
EXTERNAL
statement is used.
The filename
parameter is the name of the file to create in the directory object. The access driver does some symbol substitution to help make file names unique in parallel loads. The symbol substitutions supported for the UNIX and Windows operating systems are as follows (other platforms may have different symbols):
%p
is replaced by the process ID of the current process. For example, if the process ID of the access driver is 12345
, then exttab_%p.log
becomes exttab_12345.log.
%a
is replaced by the agent number of the current process. The agent number is the unique number assigned to each parallel process accessing the external table. This number is padded to the left with zeros to fill three characters. For example, if the third parallel agent is creating a file and bad_data_%a.bad
was specified as the file name, then the agent would create a file named bad_data_003.bad.
%%
is replaced by %
. If there is a need to have a percent sign in the file name, then this symbol substitution is used.
If the %
character is encountered followed by anything other than one of the preceding characters, then an error is returned.
If %p
or %a
is not used to create unique file names for output files and an external table is being accessed in parallel, then output files may be corrupted or agents may be unable to write to the files.
If you do not specify BADFILE
(or DISCARDFILE
or LOGFILE
), then the access driver uses the name of the table followed by _%p
as the name of the file. If no extension is supplied for the file, then a default extension will be used. For bad files, the default extension is .bad;
for discard files, the default is .dsc;
and for log files, the default is .log
.