Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Mailing Lists -> Oracle-L -> RE: ** is there PL/SQL for case
RTFM on DECODE:
DECODE(state, 1, 'CA', 2, 'OR', 3, 'WA', 4, 'AR')
Igor Neyman, OCP DBA
ineyman_at_perceptron.com
-----Original Message-----
A Joshi
Sent: Thursday, August 07, 2003 3:24 PM
To: Multiple recipients of list ORACLE-L
Hi,
Is there a statement in pl/SQL like case or is if elsif the only way. Meaning if I need to transalate state depending on input number as follows :
1 - CA
2 - OR
3 - WA
4 - AR
Can I have one statement like case 'state# :
etc.
or do i have to do :
IF state# = 1 THEN
state := 'CA';
ELSIF state# = 2 THEN
state := 'OR';
etc
Thank You.
Do you Yahoo!?
Yahoo! <http://us.rd.yahoo.com/evt=10469/*http:/sitebuilder.yahoo.com>
SiteBuilder - Free, easy-to-use web site design software
--
Please see the official ORACLE-L FAQ: http://www.orafaq.net
--
Author: Igor Neyman
INET: ineyman_at_perceptron.com
Fat City Network Services -- 858-538-5051 http://www.fatcity.com San Diego, California -- Mailing list and web hosting services ---------------------------------------------------------------------To REMOVE yourself from this mailing list, send an E-Mail message to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing). Received on Thu Aug 07 2003 - 15:39:24 CDT
![]() |
![]() |