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

Home -> Community -> Mailing Lists -> Oracle-L -> RE: sqlloader - load records with quotes " "

RE: sqlloader - load records with quotes " "

From: Knight, Jon <jknight_at_concordefs.com>
Date: Wed, 9 Feb 2005 13:35:48 -0600
Message-ID: <17ECCBDCF27C544583F2CAD928F953260221FAEF@memex1.corp.cefs.int>


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_at_concordefs.com

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_at_freelists.org [mailto:oracle-l-bounce_at_freelists.org] On Behalf Of susan lam

Sent:	Wednesday, February 09, 2005 1:01 PM
To:	Oracle-L_at_freelists.org
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
--
http://www.freelists.org/webpage/oracle-l
--
http://www.freelists.org/webpage/oracle-l
Received on Wed Feb 09 2005 - 14:38:38 CST

Original text of this message

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