Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: loading data with \n using sql-loader
> I'm trying to load into an Oracle database some data I've
exported from
> another database. Some of the fields to be loaded are
character fields
> containing '\n' (return) characters. Each '\n' character is
escaped
> with a '\' character. The data is of variable length,
separated with a
> '|' delimiter. When I try to load it with sql-loader, sql-
loader treats
> the '\n' as the end of the record, and tries to read the rest
of the
> record as the next record, which of course fails.
> I've tried using a CONTINUEIF clause on the '\' character,
and while
> this works, it concatinates the lines together, and I lose
the '\n'
> characters which are part of the text.
> Attached below is the control file for sql-loader and a
sample record.
> If anyone has any suggestions on how I can get this to work,
I'd be most
> greatful.
>
> Thanks,
>
> Adi.
>
> -- SQL-LOADER control file:
>
> LOAD DATA
> INTO TABLE I_MAIL_TEMPLATE
> REPLACE
> (ID INTEGER EXTERNAL TERMINATED BY '|',
> NAME CHAR TERMINATED BY
'|',
> TEMPLATE CHAR(700) TERMINATED BY
'|'
> )
>
>
> -- sample record in the file:
>
> 1|Voyager Project Template|\
> Bug description\
> ========================\
> \
> \
> \
> \
> \
> Bug fix description\
> ========================\
> \
> \
> \
> \
> \
> \
> Test which detects the bug:\
> \
> Bug detected by (eng. name):|
>
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.
>
>
try using the fixed option in the control file. this will force
sqlldr to read x number of characters for each line regardless
of what is contained in each line.
--
This answer is courtesy of QuestionExchange.com
http://www.questionexchange.com/showUsenetGuest.jhtml?ans_id=6401&cus_id=USENET&qtn_id=3982
Received on Mon Oct 25 1999 - 20:48:28 CDT