Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SQLSERVER x ORACLE
Message
 
 
To
24/05/2002 10:19:03
General information
Forum:
Oracle
Category:
PL/SQL
Miscellaneous
Thread ID:
00661027
Message ID:
00662099
Views:
22
This message has been marked as the solution to the initial question of the thread.
Frederico,
What version of Oracle are you using? Starting with 8.1.7, Oracle added CASE to their SQL engine. You can use the same syntax for both. Otherwise, you may have to create a new function and use it in your SQL statement. The new function can make use of the IF ELSIF ELSE END IF syntax.

HTH.
>HELLO *.*
>
>I´m writing an SQL instruction to work with SQL SERVER and ORACLE.
>
>When I'm selecting the fields, I need to use the "CASE" option of the SQL SERVER, like this:
>
>select Fieldx = CASE
>	           WHEN IT.UNIDADE=PRD.UNID1 THEN 1
>                 WHEN IT.UNIDADE=PRD.UNID2 THEN PRD.FACONV
>	         ELSE PRD.FACONV3
>               END
> from ...
>
>Using ORACLE the instruction is:
>
>select Fieldx = (DECODE(IT.UNIDADE,
>                        PRD.UNID1,1,
>                        PRD.UNID2,PRD.FACONV
>                        PRD.FACONV3 ))
>from ...
>
>I used DECODE to compare if the fields was equal, now the question:
>How can I see (in ORACLE) if the field is >, >=, <. <> ?
>
>This is the SQL SERVER instruction:
>
>select fieldx = Case
>    when p.IncIcms = 0 then 0 	
>    when p.IncIcms <> 0 and t.UsoMens = 'A' then 200
>    when p.IncIcms <> 0 and t.UsoMens <> 'A' and AliqICMS = 0 then ?Estados.AliqIcms
>    when p.IncIcms <> 0 and t.UsoMens <> 'A' and AliqICMS <> 0 then AliqICMS
>end
>from ...
>
>
>Thanks
Larry Miller
MCSD
LWMiller3@verizon.net

Accumulate learning by study, understand what you learn by questioning. -- Mingjiao
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform