| Oracle FAQ | Your Portal to the Oracle Knowledge Grid | |
|  |  | |||
Home -> Community -> Usenet -> c.d.o.server -> Re: doing data conversions
It's gonna be a large piece of code, but you can do it with Decode!
select decode( 'AL', 'alabama'
                     , 'CA', 'California'
                     , ......                    -- and so on
                     , 'Unknown'      -- value if none of the above match
                     )
Also, you could write a function that looks up the code and returns the description in a table.
This function has to be placed in a package then, and given a PRAGMA RESTRICT REFERENCES( function_name, WNDS, WNPS )
select package.function( 'abbreviation' ) from table;
Good luck!
Regards,
Patrick Sinke
Cap Gemini Ernst & Young, sector Financial Services.
jayzhee <nospam_at_newsranger.com> schreef in berichtnieuws
8_vK6.817$bi2.63683_at_www.newsranger.com...
> Hello all.  I am looking for a little point in the right direction with
 data
> conversions.
>
> I have a column that has state abbreviations (GA).  I need to convert them
 to
> the full name.  Can regular SQL do this?  Not sure if I somehow have to
 loop
> through the rows and use if/then/else logic.
>
> Tks
>
> jz
>
>
Received on Thu May 10 2001 - 08:14:16 CDT
|  |  |