The PRESERVE
BLANKS
option is affected by the presence of the delimiter clauses, as follows:
Leading whitespace is left intact when optional enclosure delimiters are not present
Trailing whitespace is left intact when fields are specified with a predetermined size
For example, consider the following field, where underscores represent blanks:
__aa__,
Suppose this field is loaded with the following delimiter clause:
TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
In such a case, if PRESERVE
BLANKS
is specified, then both the leading whitespace and the trailing whitespace are retained. If PRESERVE
BLANKS
is not specified, then the leading whitespace is trimmed.
Now suppose the field is loaded with the following clause:
TERMINATED BY WHITESPACE
In such a case, if PRESERVE
BLANKS
is specified, then it does not retain the space at the beginning of the next field, unless that field is specified with a POSITION
clause that includes some of the whitespace. Otherwise, SQL*Loader scans past all whitespace at the end of the previous field until it finds a nonblank, nontab character.