Re: How to make SQLLoader to understand \n as part of string

  • From: Kurt Van Meerbeeck <kurtvm@xxxxxxxxxx>
  • To: mnavickas@xxxxxxxxx, oracle-l <oracle-l@xxxxxxxxxxxxx>
  • Date: Thu, 24 Aug 2006 23:49:32 +0200

Hi,

You could use the stream record format, specifying a record seperator.
see http://download-uk.oracle.com/docs/cd/B10501_01/server.920/a96652/ch03.htm
for an example.
load data
infile 'example.dat'  "str '|\n'"
into table example
fields terminated by ',' optionally enclosed by '"'
(col1 char(5),
 col2 char(7))

example.dat:
hello,world,|
james,bond,|


You'll have to adjust your flatfiles to include a specific record seperator tho
...
Works from 8.1.6 and above (if I'm not mistaken)

cheers,
Kurt

At 17:23 24/08/2006 -0400, Mindaugas Navickas wrote:
>Hi,
>
>May be somebody faced this issue before and knows how to solve that. 
>
>We have a CSV file where text fields enclosed witrh ("). The issue is that
text
>fields might contain \n (new line - 0x10) character which is treated by
>SQLLoader as record terminator. Is it any way to tell loader that \n when met
>after opening apostropha to be treated as part of field and not as record
>terminator. Here is sample data (note the first line - bbb\nbbbshould be part
>of the same field:
>
>111,"aaaa","bbb
>bbb","ccc"
>222,"xxxx","yyy",
>333,"ffff","ggg","hhhh"
>
>Thank you
>
>Mindaugas Navickas
>OCP DBA
>
>
>__________________________________________________
>Do You Yahoo!?
>Tired of spam?  Yahoo! Mail has the best spam protection around 
>http://mail.yahoo.com 
>--
>//www.freelists.org/webpage/oracle-l
>
>

-- 
Kurt Van Meerbeeck
kurtvm@xxxxxxxxxx
kurt_van_meerbeeck@xxxxxx
dude@xxxxxxxxxx
http://www.ora600.org

Imagination is more important than knowledge...



--
//www.freelists.org/webpage/oracle-l


Other related posts: