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

From: eshrimp <epual_at_email.com>
Date: Tue, 09 Oct 2001 18:13:59 GMT
Message-ID: <H7Hw7.59100$ob.1430402_at_news1.rdc1.bc.home.com>


try this:
select decode(sign(10-1),1,'T','F') from dual;

pual
  "Ryan Park" <bajy_at_intizen.com> wrote in message news:5016f0aa.0110090605.2f1da2ce_at_posting.google.com...   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 - 20:13:59 CEST

Original text of this message