SQL*Loader Does Not Load Proper Data With Second INTO Clause In Control File (Doc ID 1445162.1)

Last updated on APRIL 02, 2012

Applies to:

Oracle Server - Standard Edition - Version: 10.2.0.1 to 11.2.0.3 - Release: 10.2 to 11.2
Information in this document applies to any platform.

Symptoms

SQL*Loader does not load proper data into the table when a second INTO clause is specified in control file.

For example:

OPTIONS (DIRECT=TRUE)
LOAD DATA
INFILE 'CRH_ARCH_20110701.DAT'
BADFILE CRH_ARCH_20110701.BAD
DISCARDFILE CRH_ARCH_20110701_O_FIRST.DSC
DISCARDMAX 999

INTO TABLE SCOTT.CRH_OUT_20110701 WHEN "DIRECTION" = 'O'
("CRH_ID" DECIMAL EXTERNAL NULLIF ("CRH_ID" = BLANKS)
,"CALL_DATE" DATE(14) "YYYYMMDDHH24MISS" NULLIF ("CALL_DATE" = BLANKS)
...
.....
INTO TABLE SCOTT.CRH_IN_20110701 WHEN "DIRECTION" = 'I'
("CRH_ID" DECIMAL EXTERNAL NULLIF ("CRH_ID" = BLANKS)
,"CALL_DATE" DATE(14) "YYYYMMDDHH24MISS" NULLIF ("CALL_DATE" = BLANKS)
....

The data file has two records one with DIRECTION='I' and one with O. When above control file is used it always loads data to the first table. The log file shows

Table SCOTT.CRH_OUT_20110701:
1 Row successfully loaded.
0 Rows not loaded due to data errors.
1 Row not loaded because all WHEN clauses were failed.
0 Rows not loaded because all fields were null.

Table SCOTT.CRH_IN_20110701:
0 Row successfully loaded.
0 Rows not loaded due to data errors.
2 Row not loaded because all WHEN clauses were failed.
0 Rows not loaded because all fields were null

Cause

Sign In with your My Oracle Support account

Don't have a My Oracle Support account? Click to get started

My Oracle Support provides customers with access to over a
Million Knowledge Articles and hundreds of Community platforms