Re: I want to use arithmetic operator ">" in function "Decode"

From: Greg Teets <gteets_at_cinci.rr.com>
Date: Tue, 09 Oct 2001 14:58:14 GMT
Message-ID: <3bc30ee1.131144631_at_news-server.cinci.rr.com>


You have to use the sign function inside the decode.

See this explanation:
http://www.oreview.com/9603cop.htm

Greg Teets
Cincinnati OH

On 9 Oct 2001 07:05:55 -0700, bajy_at_intizen.com (Ryan Park) wrote:

>Hi,
>
>See below SQL statement
>
>SELECT DECODE (TO_NUMBER('1'), 1, 'T', 'F' ) FROM DUAL
>
>As you could guess, this works well...Then how about next one?
>
>SELECT DECODE (:A > 1, 1, 'T', 'F' ) FROM DUAL
>
>OR
>
>SELECT DECODE (10 > 1, 1, 'T', 'F' ) FROM DUAL
>
>OR
>
>SELECT DECODE ((10>1), 1, 'T', 'F' ) FROM DUAL
>
>All these makes error "ORA-00907:missing right parenthesis.".
>
>I wonder why these are not allowed under oracle 8.0.
>
>Is this impossible?
>
>If any of you have a idea to enable this expression, plz let me know.
>
>Thanks in advance.
>
>Regards,
> Ryan
>
>-p.s
>
>As for my opinion:
>
>I've searched all Oracle documents and found that
>
>(:A>10) or (10>0) are not "Expressions" and so these are not allowed
>to
>
>be used as a first parameter of "Decode" function.
>
>If this is the "right" reason of error I think Oracle should allow
>this..Isn't it? :-)
>
>BTW, is this the "right" reason?
Received on Tue Oct 09 2001 - 16:58:14 CEST

Original text of this message