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

Home -> Community -> Usenet -> c.d.o.server -> Re: SQL*Loader Control File Syntax

Re: SQL*Loader Control File Syntax

From: Martin Haltmayer <Martin.Haltmayer_at_0800-einwahl.de>
Date: Fri, 11 Feb 2000 20:12:07 +0200
Message-ID: <38A450F7.3C2277B7@0800-einwahl.de>


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

Original text of this message

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