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: Optional arguments in procedures?

Re: Optional arguments in procedures?

From: John Russell <johnrussell10_at_home.com>
Date: Fri, 09 Mar 2001 08:31:58 GMT
Message-ID: <595hatssj1h6kk7muvql749k1fqv2lt42c@4ax.com>

On Tue, 6 Mar 2001 12:43:35 -0800, "joebob" <joebob_at_zipcon.n0t> wrote:

>I read the docs and it looks like arguments don't have a way of being defined as optional. So does that mean that I would use
>conditional statements inside the proc to accomplish the same thing? Thanks ..

If you mean PL/SQL procedures, you can define arguments as optional by giving them a default value:

create or replace procedure foo
(

	arg1 number,
	arg2 varchar2 default null,
	arg3 integer

)
... if arg2 is not null then ... -- caller passed a value

and in the caller:

foo(arg1 => 10, arg3 => 100);

John
Got an Oracle database question?
Try the search engine for the database docs at: http://tahiti.oracle.com/ Received on Fri Mar 09 2001 - 02:31:58 CST

Original text of this message

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