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

Home -> Community -> Mailing Lists -> Oracle-L -> Re: ** using decode in sql loader

Re: ** using decode in sql loader

From: Yechiel Adar <adar76_at_inter.net.il>
Date: Fri, 4 Feb 2005 09:07:38 +0200
Message-ID: <005801c50a88$49e1ec20$e300a8c0@user12344>


I love it when someone is trying all the options excepts the most obvious one.
Try: decode(:field1, 'current',sysdate, :field1) or decode(:field1, 'current',to_char(sysdate,'DD/MM/YYYY', :field1) if it is a char field as can be assumed when you compare it to 'current'.

Yechiel Adar
Mehish Computer Services
----- Original Message -----
From: "A Joshi" <ajoshi977_at_yahoo.com>
To: <jknight_at_concordefs.com>; <oracle-l_at_freelists.org> Sent: Friday, February 04, 2005 6:02 AM
Subject: RE: ** using decode in sql loader

> Thank you Jon.
>
> the question is how can I specify sysdate in place of '34' in the example
below.
>
> Please note that it is a date field :
>
> decode(:field1, 'current','<i want sysdate here>', :field1)
> i tried :sysdate and ':sysdate' and no luck. Thanks
> "Knight, Jon" <jknight_at_concordefs.com> wrote:
> It looks like you can.
>
> From Oracle's documentation:
> field1 POSITION(1:4) INTEGER EXTERNAL
> "decode(:field2, '22', '34', :field1)"
>
> Jon Knight
>
> -----Original Message-----
> From: oracle-l-bounce_at_freelists.org [mailto:oracle-l-bounce_at_freelists.org]
> On Behalf Of A Joshi
> Sent: Thursday, February 03, 2005 5:43 PM
> To: oracle-l_at_freelists.org
> Subject: ** using decode in sql loader
>
> Hi,
> I would like to use decode in sqlloader to convert data. I have a date
> field that might have the text 'current' in which case I want to convert
it
> into sysdate. Can that be done? Thanks for your help.
>
> ---------------------------------
> Do you Yahoo!?
> Yahoo! Search presents - Jib Jab's 'Second Term'
>
> --
> http://www.freelists.org/webpage/oracle-l
> --
> http://www.freelists.org/webpage/oracle-l
>
>
>
> ---------------------------------
> Do you Yahoo!?
> Yahoo! Search presents - Jib Jab's 'Second Term'
>
> --
> http://www.freelists.org/webpage/oracle-l

--
http://www.freelists.org/webpage/oracle-l
Received on Fri Feb 04 2005 - 01:14:56 CST

Original text of this message

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