Home » SQL & PL/SQL » SQL & PL/SQL » decode using multiple values (11)
decode using multiple values [message #575518] Wed, 23 January 2013 16:04 Go to next message
cplusplus1
Messages: 40
Registered: October 2012
Location: usa
Member
i am using the following within queries:
decode(qt_flag,'KT','Y',decode(qt_flag,'IT','Y','N'))

It works fine but when i use in ETL tool it is not working. Is there a way to use decode just once with multiple values like above.

Thank you very much for the helpful info.
Re: decode using multiple values [message #575525 is a reply to message #575518] Wed, 23 January 2013 19:30 Go to previous messageGo to next message
Solomon Yakobson
Messages: 1994
Registered: January 2010
Senior Member
DECODE(qt_flag,'KT','Y','IT','Y','N')

SY.
Re: decode using multiple values [message #575527 is a reply to message #575525] Wed, 23 January 2013 20:29 Go to previous messageGo to next message
Kevin Meade
Messages: 1936
Registered: December 1999
Location: Connecticut USA
Senior Member
Please explain what you mean when you say "not working".

If I recall, a correct way to write

decode(qt_flag,'KT','Y',decode(qt_flag,'IT','Y','N'))

is with

decode(qt_flag,'KT','Y',decode(qt_flag,'IT','Y','N'))

syntax looks right to me.
Re: decode using multiple values [message #575576 is a reply to message #575527] Thu, 24 January 2013 06:20 Go to previous messageGo to next message
cookiemonster
Messages: 10903
Registered: September 2008
Location: Rainy Manchester
Senior Member
The OP appears to be using an ETL tool that doesn't recognize all standard oracle functions. See here for example.

The correct solution would to be to get an ETL tool that actually works properly with oracle.
Re: decode using multiple values [message #575580 is a reply to message #575518] Thu, 24 January 2013 07:56 Go to previous message
joy_division
Messages: 4503
Registered: February 2005
Location: East Coast USA
Senior Member
cplusplus1 wrote on Wed, 23 January 2013 17:04
i am using the following within queries:
decode(qt_flag,'KT','Y',decode(qt_flag,'IT','Y','N'))


Just a little off topic here, but why are you using that decode statement and not the one that Solomon showed? Are you sure that is you decode statement? You did know that decode can check for multiple different values, right?
Previous Topic: taking latest current balance using analytical Query
Next Topic: online shopping catalogue system
Goto Forum:
  


Current Time: Thu Aug 21 03:35:30 CDT 2014

Total time taken to generate the page: 0.12620 seconds