SQL*Loader-702 Internal error Unknown column for OCI_ATTR_COL_COUNT When Using Decode In Control File (Doc ID 801402.1)

Last updated on NOVEMBER 28, 2016

Applies to:

Oracle Server - Enterprise Edition - Version: 10.2.0.1 to 10.2.0.4 - Release: 10.2 to 10.2
Information in this document applies to any platform.

Symptoms

This article covers the following errors from SQL*Loader:

SQL*Loader-702: Internal error - Unknown column for OCI_ATTR_COL_COUNT
SQL*Loader-2026: the load was aborted because SQL Loader cannot continue.

If DECODE is present in the CTL (control file) then the article might be applicable.

The problem is best illustrated by the following test case which uses the SCOTT schema.

sqlplus scott/tiger
create table test_date (name varchar2(20), dob date);

SQL> desc test_date

Name                         Null?    Type
---------------------------- -------- -----------------
NAME                                  VARCHAR2(20)
DOB                                   DATE

-- Data file test_date.txt (fields separated by TAB).
name dob
rob  20081128
nick 0
john 20080101

-- test_date.ctl
-- Can rows where data is '0' be loaded?
LOAD DATA
INFILE 'test_date.txt'
TRUNCATE
INTO TABLE test_date
FIELDS TERMINATED BY X'09'
TRAILING NULLCOLS
(
   name,
   dob DATE "YYYYMMDD" "DECODE (:dob, 0, NULL,:dob)"
)

sqlldr userid=scott/tiger control=test_date.ctl direct=true SKIP=1 log=test_date.txt

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