Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

DECODE Oracle Statement VS SQL ANYwhere

198 views
Skip to first unread message

Jeff Raymond

unread,
Apr 22, 2000, 3:00:00 AM4/22/00
to
Hi,

Does someone know if the DECODE statement used in Oracle can be found in SQL
ANYwhere. What's it's name?

Thanks for your help!

Jeff
APG

Jim Egan

unread,
Apr 22, 2000, 3:00:00 AM4/22/00
to
I don't know what the DECODE feature does. I tried to find some sort of
online books on Oracle's web site but I couldn't find anything. A large
part of their site was down. Can you describe what DECODE does?
--
Jim Egan [TeamSybase]
Houston, TX
http://www.eganomics.com

Sybase Developers Network
http://sdn.sybase.com/sdn/mec/mec_home.stm

Jeff Raymond

unread,
Apr 22, 2000, 3:00:00 AM4/22/00
to
DECODE does the same thing as the CASE statement in a PL/SQL
(transact-sql)statement. The DECODE is use within a SELECT statement to SET
the value of a compute column during a query.

Hope this will help you to answer my previous question. :-)

Jeff
APG
"Jim Egan" <dba...@eganomics.com> a écrit dans le message news:
MPG.136b85818...@forums.sybase.com...

Paul Horan

unread,
Apr 22, 2000, 3:00:00 AM4/22/00
to
The DECODE function is exactly like the CASE expression.
Here's an example:

In Oracle:
select decode( LIC_TYPE,
'U', 'Unlicensed',
'L', 'Learner',
'F', 'First-Year Probationary',
'P', 'Probationary',
'T', 'Endorsed Trainer',
'S', 'Standard',
'X', 'Disqualified',
'H', 'Held/Suspended',
'unknown') license
from drivers;

In ASA:
select (CASE LIC_TYPE
when 'U' then 'Unlicensed',
when 'L' then 'Learner',
when 'F' then 'First-Year Probationary',
when 'P' then 'Probationary',
when 'T' then 'Endorsed Trainer',
when 'S' then 'Standard',
when 'X' then 'Disqualified',
when 'H' then 'Held/Suspended',
else 'unknown'
end) as license
from drivers;

Decode is not ANSI-standard, and (I believe) the CASE expression is...

Paul Horan
VCI www.twoplus.com
Springfield, MA

"Jeff Raymond" <si...@rayonline.com> wrote in message
news:6tg2n0Ir$GA....@forums.sybase.com...

0 new messages