I'm using OracleXE (10g) and attempting to load a file into the table. The table is defined as follows:
CREATE TABLE "ERROR_CODE_MASTER"
( "ERROR_CODE" VARCHAR2(255) NOT NULL ENABLE,
"ERROR_SHORT_DESC" VARCHAR2(2000) NOT NULL ENABLE,
"SEVERITY" VARCHAR2(255),
"STATUS" VARCHAR2(255),
"LAST_SEEN_DATE" DATE,
"LAST_SEEN_TIME" TIMESTAMP (6),
"COMMENTS" VARCHAR2(4000),
"ERROR_LONG_DESC" CLOB,
CONSTRAINT "ERROR_CODE_MASTER_PK" PRIMARY KEY ("ERROR_CODE") ENABLE
)
I'm bringing in a file using the following sql*loader control file:
OPTIONS
(
SKIP = 0
)
LOAD DATA
INFILE 'error_code_master.txt'
BADFILE 'error_code_master_bad.txt'
APPEND
INTO TABLE error_code_master
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
TRAILING NULLCOLS
(
error_code,
error_short_desc,
severity,
error_long_desc,
last_seen_date,
last_seen_time
)
When I use this control file, I get the following error...
Record 1: Rejected - Error on table ERROR_CODE_MASTER, column ERROR_LONG_DESC.
Field in data file exceeds maximum length
If I change the control file as follows, I get a different error...
OPTIONS
(
SKIP = 0
)
LOAD DATA
INFILE 'error_code_master.txt'
BADFILE 'error_code_master_bad.txt'
APPEND
INTO TABLE error_code_master
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
TRAILING NULLCOLS
(
error_code,
error_short_desc,
severity,
error_long_desc CLOB,
last_seen_date,
last_seen_time
)
Syntax error at line 20,
expecting ",", or ")", found CLOB.
error_long_desc CLOB,
Also get an invalid date format on the date field coming in. The date is actually coming in the file in the following format: 1/1/2000 0:00:00
CREATE TABLE "ERROR_CODE_MASTER"
( "ERROR_CODE" VARCHAR2(255) NOT NULL ENABLE,
"ERROR_SHORT_DESC" VARCHAR2(2000) NOT NULL ENABLE,
"SEVERITY" VARCHAR2(255),
"STATUS" VARCHAR2(255),
"LAST_SEEN_DATE" DATE,
"LAST_SEEN_TIME" TIMESTAMP (6),
"COMMENTS" VARCHAR2(4000),
"ERROR_LONG_DESC" CLOB,
CONSTRAINT "ERROR_CODE_MASTER_PK" PRIMARY KEY ("ERROR_CODE") ENABLE
)
I'm bringing in a file using the following sql*loader control file:
OPTIONS
(
SKIP = 0
)
LOAD DATA
INFILE 'error_code_master.txt'
BADFILE 'error_code_master_bad.txt'
APPEND
INTO TABLE error_code_master
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
TRAILING NULLCOLS
(
error_code,
error_short_desc,
severity,
error_long_desc,
last_seen_date,
last_seen_time
)
When I use this control file, I get the following error...
Record 1: Rejected - Error on table ERROR_CODE_MASTER, column ERROR_LONG_DESC.
Field in data file exceeds maximum length
If I change the control file as follows, I get a different error...
OPTIONS
(
SKIP = 0
)
LOAD DATA
INFILE 'error_code_master.txt'
BADFILE 'error_code_master_bad.txt'
APPEND
INTO TABLE error_code_master
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
TRAILING NULLCOLS
(
error_code,
error_short_desc,
severity,
error_long_desc CLOB,
last_seen_date,
last_seen_time
)
Syntax error at line 20,
expecting ",", or ")", found CLOB.
error_long_desc CLOB,
Also get an invalid date format on the date field coming in. The date is actually coming in the file in the following format: 1/1/2000 0:00:00