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

Home -> Community -> Usenet -> c.d.o.misc -> Re: DECODE and boolean-expression

Re: DECODE and boolean-expression

From: Mark C. Stock <mcstockX_at_Xenquery>
Date: Tue, 24 Jan 2006 15:27:16 -0500
Message-ID: <n82dncpiU6o1EEvenZ2dnUVZ_vmdnZ2d@comcast.com>

"Alexander Mueller" <millerax_at_hotmail.com> wrote in message news:43d68d08$0$21030$9b4e6d93_at_newsread2.arcor-online.net...
> Hi
>
> how can i use Decode if I want to evaluate an boolean expression?
> I want to convert an Access-SQL-Statement using IIF:
>
> IIf (Val > 100, ID, 9999) As ID
>
> How can I check if Val is bigger then 100 with Decode,
> my pseudo code looks like:
>
> Decode (Val > 100, true, ID, 9999) As ID
>
> but what's the equivalent for 'true' in PL/SQL?
>
> Mfg,
> Alex

CASE expression (depending on your DB version)

otherwise, use a DECODE on a SIGN expression (returns -1, 0, or 1 and can be used to kludge if-then-else logic)

++ mcs Received on Tue Jan 24 2006 - 14:27:16 CST

Original text of this message

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