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: Nuno Souto <nsouto_at_nsw.bigpond.net.au.nospam>
Date: Sun, 03 Jun 2001 01:05:49 GMT
Message-ID: <3b198b94.967846@news-server>

On Sun, 03 Jun 2001 08:57:46 +0800, Dino Hsu <dino1_at_ms1.hinet.net> wrote:

>
>I read posts in an earlier thread of this news group, and realized
>that variable number of parameters can be implementd in this way:
>FUNCTION sf_case(i_case1 IN BOOLEAN DEFAULT FALSE, i_case2 IN BOOLEAN
>DEFAULT FALSE) RETURN NUMBER;
>with the rules:
>1.the missing parameters should be trailing.
>2.a max number of parameters, say 10 parameters, must be known in
>advance. The max number of parameters cannot be unknown as do in other
>3G languages such as C and PASCAL.
>

Sounds like a perfect test case for using overloaded function calls. And using the keyword method of specifying parameters, which allows us to completely omit any parameter(s) that is to be set to NULL.

Cheers
Nuno Souto
nsouto_at_bigpond.net.au.nospam
http://www.users.bigpond.net.au/the_Den/index.html Received on Sat Jun 02 2001 - 20:05:49 CDT

Original text of this message

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