Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: SQL Loader question
The sample you have given does not contain a NULL - it contains the text
'null'. Is column 'b' a number or a very short (<4 chars) string? To
translate this use a decode statement in you SQL*loader control section:
...
fields terminated by ',' optionally enclosed by '"'
(
id,
b "decode(UPPER(:b), 'NULL', NULL, :b)",
c
)
begindata
1,null,'c'
...
<david_petit_at_yahoo.com> wrote in message news:7vffr9$uqp$1_at_nnrp1.deja.com...
> I am a beginner of using SQL loader. I have a problem in using loader.
> I have a control file as follows:
>
> load data
> infile *
> append
> into table testing
> fields terminated by ',' optionally enclosed by '"'
> (id,b,c)
> begindata
> 1,null,'c'
> 2,3,'c'
> ..
>
> Loading has error due to the NULL value. How can I handle the NULL
> value in the control file? Moreover, how can I handle the NULL value if
> the NULL value appears at the end of the line?
>
> Thanks,
> David
>
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.
Received on Mon Nov 01 1999 - 16:46:04 CST