Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: DECODE and boolean-expression
Alexander Mueller wrote:
> Mark C. Stock schrieb:
>
>> "Alexander Mueller" <millerax_at_hotmail.com> wrote:
>>> 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)
CASE works in 8i. You just need to use it in the form of Native Dynamic SQL.
-- Daniel A. Morgan http://www.psoug.org damorgan_at_x.washington.edu (replace x with u to respond)Received on Wed Jan 25 2006 - 10:53:08 CST
![]() |
![]() |