RE: sqlloader - load records with quotes " "

  • From: "Knight, Jon" <jknight@xxxxxxxxxxxxxx>
  • To: "'susanzlam@xxxxxxxxx'" <susanzlam@xxxxxxxxx>, Oracle-L@xxxxxxxxxxxxx
  • Date: Wed, 9 Feb 2005 13:35:48 -0600

It's a problem when any given construct serves multiple purposes in one
context.  Probably some complex parsing alorithm would work, but I'm not too
skilled there.

For SQLLDR, you should be able to remove the OPTIONALLY ENCLOSED BY '"'
phrase and add a function to your control file to strip the quotes from the
fields you don't want them in.  For the "jack "King" => jack "King" problem,
one might suggest adding an ltrim() in the control file, but I can't really
say without knowing what the rest of the data looks like.  For instance,
"Sambo" Samuel would get butchered by the ltrim().

LOAD DATA
APPEND INTO TABLE testing
FIELDS TERMINATED BY ','
TRAILING NULLCOLS
(
  a
 ,b  "replace ( :b ,'"' ,'' )"
)

Regards,
Jon Knight
Senior Database Analyst
2525 Horizon Lake Drive, Suite 120
Memphis, TN  38133
JKnight@xxxxxxxxxxxxxx
901.371.8000 - Phone
800.238.7675 - Phone
901.380.8336 - Fax
www.FirstData.com
First Data's merger with Concord creates "One Company" with enhanced choice,
voice and innovation for all customers.

 -----Original Message-----
From:   oracle-l-bounce@xxxxxxxxxxxxx [mailto:oracle-l-bounce@xxxxxxxxxxxxx]
On Behalf Of susan lam
Sent:   Wednesday, February 09, 2005 1:01 PM
To:     Oracle-L@xxxxxxxxxxxxx
Subject:        sqlloader - load records with quotes " "

hi,
Is there a way to load the following records using
sqlldr? 

"jack "King",","LEE"

The record should be loaded in the table as :
field1 - jack "King",
field2 - LEE

Control file:
LOAD DATA
APPEND INTO TABLE testing
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
TRAILING NULLCOLS 
(a,b)

Data file format:
<field1>,<field2>

thanks.

susan



                
__________________________________ 
Do you Yahoo!? 
Yahoo! Mail - 250MB free storage. Do more. Manage less. 
http://info.mail.yahoo.com/mail_250
--
//www.freelists.org/webpage/oracle-l
--
//www.freelists.org/webpage/oracle-l

Other related posts: