Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: SQL*Loader Control File Syntax
Try
...
INVCUST "decode (:INVCUST, 'yes', 1, 'no', 0)",
...
The quotation marks are important as they tell sqlloader that it has to apply a SQL function. The colon (:) is needed because you have to reference the bind variable which sqlloader is creating.
Martin
News wrote:
>
> Hello everyone! I'm new to Oracle and I'm in the middle of transferring our
> data from DataEase into Oracle 8i using SQL*Loader. I want to enter a 1
> where INVCUST='yes' and a 0 where INVCUST='no'.
> I'm having trouble with the proper syntax. I've included a little example
> of one way I've tried and it's not working for me. Would anyone be able to
> tell me what I'm doing wrong?
> Thanks!
> Lesley
>
> FBEImp.ctl ........
>
> Load Data
>
> INFILE 'fbe.txt' "var"
> BADFILE 'fbe.bad'
> DISCARDFILE 'fbe.dsc'
>
> INSERT INTO TABLE frghtbill
> fields terminated by '~' optionally enclosed by " "
>
> TRAILING NULLCOLS
> (
> ....
> FIELDS
> INVCUST iif(INVCUST='yes',1,0),
> FIELDS
> ....
> terminated by whitespace)
>
> I've also tried
> INVCUST IF INVCUST='yes' THEN
> INVCUST=1;
> ELSE
> INVCUST=0;
> END IF
Received on Fri Feb 11 2000 - 12:12:07 CST