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

Home -> Community -> Usenet -> c.d.o.tools -> Re: Switch, select case, etc.

Re: Switch, select case, etc.

From: Brian Peasland <peasland_at_edcmail.cr.usgs.gov>
Date: 2000/07/10
Message-ID: <3969DEA2.190A1609@edcmail.cr.usgs.gov>#1/1

Alternatively, you can use the DECODE statment in straight SQL statements. For example:

   SELECT DECODE(column,'a','b','c','d','e') FROM table;

The output is determined by the value in the column. If 'a' then output is 'b'. If value is 'c' then output is 'd'. If none of the above, then default to 'e'.

HTH,
Brian

Breno de Avellar Gomes wrote:
>
> Use if..elsif..else
> It acts as C switch..case..default
>
> mAd hAcker wrote:
> >
> > Is there a switch, or select case type statement in PL/SQL? Or do I have to
> > use if..elsif..elsif..???
> >
> > --
>
> --
> ----------------------------------------------------
> | -°) (°- |
> | /\\ Linux the choice of the GNU generation //\ |
> | _\_v v_/_ |
> ----------------------------------------------------
>
> Breno de Avellar Gomes
> Database Applications & Internet Developer
>
> Arquivo-Sistemas de Bases de Dados
> P. O. Box 5006
> EC Municipio
> 4017-001 Porto
> Portugal
>
> brenogomes_at_ieee.org
> Cellular phone: 351-917383469
> Cellular messages: 917383469_at_sms.telecel.pt
> ICQ # 35567342
>
> Toll free fax and answering machine from USA
> 1-888-EXCITE2 extension 291-303-8152
>
> Outside USA (international fares apply)
> 1-917-463-3173
 

-- 
========================================
Brian Peasland
Raytheons Systems at
  USGS EROS Data Center
These opinions are my own and do not
necessarily reflect the opinions of my 
company!
========================================
Received on Mon Jul 10 2000 - 00:00:00 CDT

Original text of this message

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