You can use the FIELD
NAMES
clause in the SQL*Loader control file to specify field order. The syntax is as follows:
FIELD NAMES {FIRST FILE|FIRST FILE IGNORE|ALL FILES|ALL FILES IGNORE|NONE}
The FIELD
NAMES
options are:
FIRST
FILE
--Indicates that the first data file contains a list of field names for the data in the first record. This list uses the same delimiter as the data in the data file. The record is read for setting up the mapping between the fields in the data file and the columns in the target table. The record is skipped when the data is processed. This can be useful if the order of the fields in the data file is different from the order of the columns in the table, or if the number of fields in the data file is different from the number of columns in the target table
FIRST
FILE
IGNORE
--Indicates that the first data file contains a list of field names for the data in the first record, but that the information should be ignored. The record will be skipped when the data is processed, but it will not be used for setting up the fields.
ALL
FILES
--Indicates that all data files contain a list of field names for the data in the first record. The first record is skipped in each data file when the data is processed. The fields can be in a different order in each data file. SQL*Loader sets up the load based on the order of the fields in each data file.
ALL
FILES
IGNORE
--Indicates that all data files contain a list of field names for the data in the first record, but that the information should be ignored. The record is skipped when the data is processed in every data file, but it will not be used for setting up the fields.
NONE
--Indicates that the data file contains normal data in the first record. This is the default.
The FIELD
NAMES
clause cannot be used for complex column types such as column objects, nested tables, or VARRAYs.