Re: SQL loader (SQLLDR73) "Decode" statement

From: Sybrand Bakker <postbus_at_sybrandb.demon.nl>
Date: Wed, 15 Mar 2000 21:46:54 +0100
Message-ID: <953154876.16683.0.pluto.d4ee154e_at_news.demon.nl>


> VISIT_TYPE_CD POSITION(21:23) CHAR
> "decode(:visit_type_cd,
> 'ED','01',
> 'RET','02',
> 'UNS','03',
> '99',

                           NULL)",

should work. NULL is the 'when no conditions apply' branch here

Hth,

Sybrand Bakker, Oracle DBA

<nefilm_at_my-deja.com> wrote in message news:8aos1t$72v$1_at_nnrp1.deja.com...
> HI,
>
> I am having trouble importing a flat field into ORACLE with the SQLLDR73
> tool. I am trying to decode one of the fields that is coming ininto 1
> of 4 values, with everything else being defaulted to value '99'.
>
> How do I tell SQLLDR that when the field is blank, leave it bank??
>
> This does not work :
>
> VISIT_TYPE_CD POSITION(21:23) CHAR
> "decode(:visit_type_cd,
> null,''
> 'ED','01',
> 'RET','02',
> 'UNS','03',
> '99')",
>
> but this works just fine, but does not do what I want:
> VISIT_TYPE_CD POSITION(21:23) CHAR
> "decode(:visit_type_cd,
> 'ED','01',
> 'RET','02',
> 'UNS','03',
> '99')",
>
>
>
> Any ideas????
>
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.
Received on Wed Mar 15 2000 - 21:46:54 CET

Original text of this message