Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can't load a CLOB into OracleXE using sql*loader

Status
Not open for further replies.

ragolia

Programmer
Sep 11, 2003
13
US
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


 
Want to add one more point. Based upon posts in other forums, it is possible that OracleXE sets a 'default' LOB (CLOB, or BLOB) maximum size of 32k. Does anyone know how to change that default. It will not work for what I'm trying to do.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top