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: Decode equivalent within pl/sql?

Re: Decode equivalent within pl/sql?

From: Brian Peasland <dba_at_nospam.peasland.net>
Date: Mon, 13 Nov 2006 16:59:09 GMT
Message-ID: <J8oHux.9xu@igsrsparc2.er.usgs.gov>


> Thanks I may not have made it clear - I know I can use DECODE in a
> select stamenet within PL/SQL but I was looking for a nicer way to code
> the following (example) without having to define a variable into which
> to put the value I want before calling the proc.
>
> e.g
>
> begin
> -- stuff
> utility_proc(p1 => 'ADD',
> p2 => decode(thing,'val1','res1','val2','res2','dflt'));
> --
> end;
>
> Now I know I cannot use the decode there and it seems that I have to
> look at the value of "thing" using either
> "if then else"
> or a
> "select decode(....) into var from dual;"
>
>

Note to potential posters....

Please state the thing you are trying to resolve rather than water down your example to the point where you are no longer explaining exactly what you are trying to achieve. You will find that you get the exact answer you are looking for...and get than answer sooner.

Cheers,
Brian

-- 
===================================================================

Brian Peasland
dba_at_nospam.peasland.net
http://www.peasland.net

Remove the "nospam." from the email address to email me.


"I can give it to you cheap, quick, and good.
Now pick two out of the three" - Unknown
Received on Mon Nov 13 2006 - 10:59:09 CST

Original text of this message

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