Home » RDBMS Server » Server Utilities » field length issue
field length issue [message #72050] Wed, 26 February 2003 19:43 Go to next message
ram
Messages: 95
Registered: November 2000
Member
Hello,
I am trying to load data using the following ctl file

load data
infile 'description_test.txt'
badfile 'description_test.bad'
discardfile 'description_test.dsc'

insert
into table description_test
fields terminated by ',' optionally enclosed by '"'
(
item_id,
description
)

Description filed is 4000 C long

In my sample data, my description filed is less than 1000 characters, but still the loader is rejecting the records (Exceeds maximum length)

I generated the text file from an original excel file and the description text has many special characters.

I am able to update the table directly using sql navigator

Thank you for your help in advance
Ram
Re: field length issue [message #72055 is a reply to message #72050] Thu, 27 February 2003 05:55 Go to previous messageGo to next message
Mahesh Rajendran
Messages: 10707
Registered: March 2002
Location: oracleDocoVille
Senior Member
Account Moderator
-- u can use substring...something like this
insert into table mytable
fields terminated by ',' optionally enclosed by '"' 
(
item_id,
description char "substr(:description,1,30)"
)

Re: field length issue [message #72059 is a reply to message #72055] Thu, 27 February 2003 11:13 Go to previous message
ram
Messages: 95
Registered: November 2000
Member
Hello Mahesh,
My description filed can be 2000 char long

should my ctl be ..

insert into table mytablefields terminated by ',' optionally enclosed by '"' (item_id,description char "substr(:description,1,2000)")

Thank you in advance

Ram
Previous Topic: Importing Oracle Dump
Next Topic: Improving the performance of Oracle Import
Goto Forum:
  


Current Time: Wed May 15 22:19:39 CDT 2024