Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Mailing Lists -> Oracle-L -> sqlldr question: How to set control file to load variable length data?
Hi:
I am trying to use sqlldr to load some text data into oracle db without much success.
The text file looks something like this:
1234567,ABC,999,aaa
5678,xy,this is col2,b
....
Basically it is a variable length fields with comma as separator. I have no problem using sqlldr to load fixed length data. But with variable length data, I tried several ways in control file such as:
LOAD DATA
INFILE 't1.dat'
INTO TABLE T1
FIELDS TERMINATED BY ','
(C1,
C2,
C3,
C4)
and
LOAD DATA
INFILE 't1.dat'
INTO TABLE T1
FIELDS TERMINATED BY ','
(C1 char(12),
C2, char(3), C3, char(20) C4 char(5))
and none of them worked. They always gave me Sql*loader-524 error: partial record found at end of datafile(t1.ctl). I also tried in file "t1.dat" to make sure the last record has extra carriage return. It does not seems to help.
I am suspecting that there might be something wrong in my control file syntax. Anyone know the correct syntax in control file to load my data? Thanks.
Guang