Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: sqlload, mission impossible ?

Re: sqlload, mission impossible ?

From: John Strange <jstrange_at_imtn.dsccc.com>
Date: 1997/01/04
Message-ID: <5alrjh$2si@camelot.dsccc.com>#1/1

Your problem is caused by the extra quote after the 10.

It seems for every printable terminator we picked (~'`#@|\&"%_), there was at least one text string with our terminator.

What we did was to set the text terminater to a control underscore (a hex 1F) .
The terminator was put by the .ctl creation code. Here is a .ctl snippet for using the hex 1F.

load data
infile *
insert into table srlexp_pkg
fields terminated by ',' optionally enclosed by X'1F' (SEQNUM, Allen Kirby (akirby_at_att.com) wrote:
: Salman Mughal wrote:
: >
 

: > We have been trying to load a file with lots of lines line the following :
: >
: > "423567","I would not touch it with a 10" stick","35",
: >
: > LOAD
: > INFILE 'temp.txt'
: > TERMINATED BY ',' ENCLOSED BY '"'
: > INTO TABLE testdb
: > ( Part_Number ,
: > Description ,
: > Available )
: >
: > But keep getting the following error :
: >
: > No terminator found after TERMINATED and ENCLOSED field
: >
 

: >
: > Salman Mughal
: > salman_at_netdoor.com
 

: I think it's either the " in 10" - which looks like the end of the
: field - or the trailing comma at the end of the line. It's probably
: the ", but try deleting the trailing comma first since this will only
: take a few minutes on a test file. To fix the ", you'll either have
: to change the " in 10" and each similar occurrence to something else in
: the input file and translate it later or change the ENCLOSED character
: and modify the input file. If you're on Unix, this is easily done with
: sed or vi. If you're on NT, your guess is as good as mine as to how
: to do this. Changing the ENCLOSED char would involve the following
: steps (in ed notation):
: s/^"/'/ change the beginning delimiter on the line
: s/","/','/g change the rest of the delimeters (g means global)
: And if you need the trailing comma:
: s/",/', change the last delimeter
 

: Remember to change the ENCLOSED parameter in the control file.
: Good Luck.
 

: --
: ---
: Allen Kirby AT&T ITS Production Services
: akirby_at_att.com Alpharetta, GA.

--
This posting represents the personal opinions of the author. It is not the
official opinion or policy of the author's employer. Warranty expired when you
opened this article and I will not be responsible for its contents or use.
Received on Sat Jan 04 1997 - 00:00:00 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US