Re: CASE - WHEN ELSE ORACLE 7.3
From: Craig Beevers <cbeevers_at_easynet.co.uk>
Date: Sun, 29 Aug 1999 21:31:02 +0100
Message-ID: <7qc5j6$1p6r$1_at_quince.news.easynet.net>
Date: Sun, 29 Aug 1999 21:31:02 +0100
Message-ID: <7qc5j6$1p6r$1_at_quince.news.easynet.net>
The example as requested.
This example looks at data from a Inventory tool, if the make & model is not retrieved by the tool, I look in the Bios to see if I can find the Manufacturer. If I can't find a standard manufacturer I class the machine as a 'clone'.
(This works in SQL Server 6.5. )
--- UPDATE DISKS_LOCAL_SP SET MAKEMODEL = (SELECT DISTINCT makemodel = CASE WHEN bios_type like '%Toshiba%' then 'Toshiba' WHEN bios_type like '%IBM%' then 'IBM' WHEN bios_type like '%COMPAQ%' then 'COMPAQ' ELSE 'CLONE' END FROM CFGM.nodes_local WHERE NODE_NAME = NL.NODE_NAME ) FROM CFGM.nodes_local NL , DISKS_LOCAL_SP DLS WHERE DLS.NODE_NAME = NL.NODE_NAME AND MAKEMODEL = ''Received on Sun Aug 29 1999 - 22:31:02 CEST
> >Have you looked up the decode pseudo-function?
> I've looked up the function list in the Oracle Online documentation- no
sign of 'CASE'' or its equivalent. I have just referenced a generic SQL2 reserved keyword list and 'CASE' is there. From the example above. what's the "Oracle way" to achieve the same results. ? -- [Quoted] Best Regards Craig Beevers Craig Beevers <cbeevers_at_easynet.co.uk> wrote in message news:7qbnih$18ic$1_at_quince.news.easynet.net...
> Hi,
>
> Does Oracle 7.3 on NT support the CASE (When - then - else) statement ?
>
> I have tried it in selects & updates and I still have no luck . I have
tried
> the On-line help but cannot find a reference to it.
>
> If anyone has been successful in deploying the command, please could you
> forward an example of the query structure.
>
> Many Thanks
> --
> Best Regards
>
> Craig Beevers
> E-mail: beevers_at_maincontrol.co.uk
>
>
>