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: How to write a function with variable parameters?

Re: How to write a function with variable parameters?

From: Spencer <spencerp_at_swbell.net>
Date: Sat, 2 Jun 2001 23:27:29 -0500
Message-ID: <8%iS6.190$Z42.9888@nnrp1.sbc.net>

I've never run across the ELEMENT_TYPE datatype for an Oracle8 function argument.

I'm going to have to do some research on this one.

Thanks.

"Paul Q" <paulq_at_home.com> wrote in message news:MU8S6.10857$Be4.2880654_at_news3.rdc1.on.home.com...
> create or replace function sf_case (case_1 element_type, case_2 element
> type)
> return var_name element_type;
> is
> begin
> ....
>
> return(var_name);
> end;
>
> "Dino Hsu" <dino1_at_ms1.hinet.net> wrote in message
> news:dpehht06m4vpvhj6nhihqdrna629aur9r2_at_4ax.com...
> > Dear all,
> >
> > To similate the Oracle 8i CASE WHEN ... THEN ... ELSE ... END clause
> > in Oracle 8, I need to write a stored function like this:
> > FUNCTION sf_case(case1, case2, case3, ..., case-n, ...) RETURN NUMBER
> > where case-n's are all of boolean type.
> > This function will check case1 first, then case2, case3, etc., and
> > return the n that first evaluates to true.
> >
> > An extended edition is like this:
> > FUNCTION sf_case_ex(case1, value1, case2, value2, case3, value3, ...)
> > RETURN value_type
> > where value-n's are the corresponding return values.
> >
> > These two functions will compansate the limited DECODE() built-in
> > function in Oracle 8. I cannot figure out how at the moment, I hope
> > someone can help me with this. Thanks in advance.
> >
> > Dino
> >
>
>
Received on Sat Jun 02 2001 - 23:27:29 CDT

Original text of this message

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