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

Home -> Community -> Usenet -> c.d.o.server -> Decode equivalent within pl/sql?

Decode equivalent within pl/sql?

From: Jeremy <jeremy0505_at_gmail.com>
Date: Mon, 13 Nov 2006 14:11:10 -0000
Message-ID: <MPG.1fc28d4ec7a09f3198a350@news.individual.net>


9iR2

As I understand it you can only use DECODE as part of a SQL statement

e.g. select decode(var,

'A','LetterA',
'B','LetterB',
'Lettersomethingelse')
from dual;

In a pl/sql statement, you cannot code e.g.

  l_string := decode(.....

What do you use to achieve a similar result - or do you set the value into a variable beforehand with an
 if
 elsif
 end if

structure?

Thanks

-- 
jeremy

 ============================================================
   ENVIRONMENT:                                             
   Oracle 9iR2 / Oracle HTTP Server / mod_plsql / Solaris 8 
 ============================================================
Received on Mon Nov 13 2006 - 08:11:10 CST

Original text of this message

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