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: Patrick Sinke <patrick.sinke_at_capgemini.nl>
Date: Mon, 14 May 2001 10:21:52 +0200
Message-ID: <989830932.572549@sleeper.capgemini.nl>

Hi,

that's a nice trick! I don't think I would have come up with that! Though I must say that I prefer to use a stored function as described in my posting. It is more generic and flexible, and errors are less likely to occur.

Regards,

Patrick Sinke
Cap Gemini Ernst & Young, sector Financial Services

John Russell <johnrussell10_at_home.com> schreef in berichtnieuws 67spftom6dc1lrupkb7g6ovc6bpa7j19f6_at_4ax.com...
> On Thu, 10 May 2001 15:14:16 +0200, "Patrick Sinke"
> <patrick.sinke_at_capgemini.nl> wrote:
> >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
>
> If you have too many choices in DECODE, it errors out. A way around
> this is to make the final default value NULL and use NVL to call a
> second DECODE if the first one didn't have any matches. (And a third
> if you really have a lot of values.)
>
> Not that I have ever done this! :-)
>
> John
> --
> Got an Oracle database question?
> Try the search engine for the database docs at:
> http://tahiti.oracle.com/
Received on Mon May 14 2001 - 03:21:52 CDT

Original text of this message

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