Home » SQL & PL/SQL » SQL & PL/SQL » LOV/ Foreign values (10G)
icon7.gif  LOV/ Foreign values [message #332026] Mon, 07 July 2008 05:10 Go to next message
Gr1m
Messages: 2
Registered: July 2008
Junior Member
Hi everybody,

I am VERY new to ORACLE, just getting the idea of the fancier stuff now.

What I need to do for this one client is to create some views, but some of these views contain integers, which need to be translated into corresponding text values. These values are not in the database and so I need some kind of list of values type thing but in a query.

For example is the CUST_STATUS_ID field = 1, then the query must display "Active Customer" or if CUST_STATUS_ID = 2 it must display "Cancelled Customer" etc.

SAS for example supports this:

proc format;
value edlevel 1-12 = 'No High School Diploma'
12 = 'High School Diploma'
13 = 'Completing Associate'
14 = 'Associate'
15 = 'Completing Bachelors'
16 = 'Bachelors'
17 = 'Completing Masters'
18 = 'Masters'
19 = 'Completing PhD'
20-99 = 'PhD'
. = 'No Education Data';
run;

I need something similar if possible.

Any help is appreciated Razz

Thanx
Re: LOV/ Foreign values [message #332027 is a reply to message #332026] Mon, 07 July 2008 05:13 Go to previous messageGo to next message
pablolee
Messages: 2834
Registered: May 2007
Location: Scotland
Senior Member
Hi
A simple decode should be good enough based on your description
Re: LOV/ Foreign values [message #332029 is a reply to message #332026] Mon, 07 July 2008 05:16 Go to previous message
Gr1m
Messages: 2
Registered: July 2008
Junior Member
That'll do it! Thanx! Smile
Previous Topic: how to create view dynamically
Next Topic: sql query
Goto Forum:
  


Current Time: Sun Dec 04 16:24:59 CST 2016

Total time taken to generate the page: 0.05909 seconds