Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: DECODE being depricated???

Re: DECODE being depricated???

From: Lloyd Sheen <sqlguy_at_hotmail.com>
Date: Sat, 22 Feb 2003 16:07:30 GMT
Message-ID: <6fN5a.46964$Zr%.1388@news01.bloor.is.net.cable.rogers.com>


Some info about both

The CASE expression made its SQL debut in the SQL-92 specification in 1992. Eight years later, Oracle included the CASE expression in the 8.1.6 release. Like the DECODE function, the CASE expression enables conditional logic within an SQL statement, which might explain why Oracle took so much time implementing this particular feature. If you have been using Oracle for a number of years, you might wonder why you should care about the CASE expression, since DECODE does the job nicely. Here are several reasons why you should make the switch:

  a.. CASE expressions can be used everywhere that DECODE functions are permitted.

  b.. CASE expressions are more readable than DECODE expressions.
  c.. CASE expressions execute faster than DECODE expressions.1
  d.. CASE expressions handle complex logic more gracefully than DECODE
expressions.
  e.. CASE is ANSI-compliant, whereas DECODE is proprietary. The only downside to using CASE over DECODE is that CASE expressions are not supported in Oracle8 i 's PL/SQL language. If you are using Oracle9 i , however, any SQL statements executed from PL/SQL may include CASE expressions.

The SQL-92 specification defines two distinct flavors of the CASE expression: searched and simple . Searched CASE expressions are the only type supported in the Oracle8 i release. If you are using Oracle9 i , you may also use simple CASE expressions.

"DA Morgan" <damorgan_at_exesolutions.com> wrote in message news:3E565B0E.3E84349E_at_exesolutions.com...
> Mike Cohen wrote:
>
> > Any idea why?
> >
> > Commencing in what version of Oracle?
> >
> > Man, just when I was getting good at it too!!! :(
> >
> > thanks,
> >
> > mike
>
> I've found no reference to this at otn.oracle.com. Can you point to a
> reference?
>
> Thanks.
>
> Daniel Morgan
>
Received on Sat Feb 22 2003 - 10:07:30 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US