I tried the following code and it did not work:
select case when vendor_code = 1 then 'One' when vendor_code = 2
then 'Two' else 'Whatever' end from sites
and
select case when vendor_code = 1 then result('One') when vendor_code = 2
then result('Two') else result('Whatever') end from sites
I did not see the CASE statement as an option in the Oracle book
I have or the on-line docs. The above code was run directly from
T.O.A.D. (interactive tool for Orcale developers). The error message
I get is: ORA00923 - FROM keyword not found where expected...
>Tom,
>
>SELECT case when search-condition(1) then result(1) ;
> when search-condition(2) then result(2) ;
> else result(x) end ;
> FROM Table
>
>(courtesy of Stephen Russell
>Memphis Visual FoxPro user Group)
>
>
>
>
>>Is there a function in Oracle that emulates what
>>the VFP IIF() function does? The closest thing
>>I have seen is the DECODE() function.
>>
>>What I need to do is as follows in a SQL passthru statement:
>>
>>IIF(num_trys > max_trys, 'True', 'False') AS fieldname
Previous
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only