Re: (newbie ?) : SELECT within a DECODE in ORACLE

From: CaffeineJunkie <tooantsy_at_yahoo.com>
Date: 11 Apr 2002 15:54:06 -0700
Message-ID: <9fe0e50c.0204111454.14d61af2_at_posting.google.com>


"Valentin Minzatu" <vminzatu_at_rogers.com> wrote in message news:<o2Is8.30323$Oo1.23233_at_news02.bloor.is.net.cable.rogers.com>...
> DECODE syntax:
> DECODE( expr, search, result, [expr, search, result, ...], default)
>
> If you format you text like below, you'll see that your decode cannot work
> as you compare a number with a character ....
>
> DECODE( B.issue_type, 6, E.status_desc,
> 8, (select s.status_desc from item_tbl I, status_tbl S
> where I.status_no = S.status_no and I.item_id= B.item_id), ' '
> )

Not sure what you meant about comparing a number with a character in my DECODE statement. Issue type is defined as numeric and i'm checking for 6 and 8, displaying null for all other issue types.

Anyway, I found out that SELECT within a DECODE does work - but only on Oracle 8i and higher.
Our co. (finally) upgraded and my query now runs.

Thanks. Received on Fri Apr 12 2002 - 00:54:06 CEST

Original text of this message