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 -> Re: doing data conversions

Re: doing data conversions

From: jz <nospam_at_newsranger.com>
Date: Fri, 11 May 2001 10:55:46 GMT
Message-ID: <SyPK6.1023$j65.72772@www.newsranger.com>

yeah it was, i posted too soon, it all worked fine.

tks for the help.

In article <989506701.904901_at_sleeper.capgemini.nl>, Patrick Sinke says...
>
>That should be easy, don't you think?
>
>update table
>set state = decode (state,'ID','Indiana','PA','Pennsylvania')
>
>Regards,
>
>Patrick Sinke
>Cap Gemini Ernst & Young, sector Financial Services.
>
>
>
>jayzhee <nospam_at_newsranger.com> schreef in berichtnieuws
>QcxK6.975$bi2.74513_at_www.newsranger.com...
>> If I use this syntax i get what I want displayed, how do you actually
 write this
>> to update the column?
>>
>> select state, decode (state,'ID','Indiana','PA','Pennsylvania') from user
>> /
>>
>> Thanks!!
>>
>>
>>
>>
>>
>> In article <989502911.131927_at_sleeper.capgemini.nl>, Patrick Sinke says...
>> >
>> >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
>> > )
>> >from table
>> >
>> >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 Fri May 11 2001 - 05:55:46 CDT

Original text of this message

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