Home » SQL & PL/SQL » SQL & PL/SQL » null parameters in a PL/SQL procedure
null parameters in a PL/SQL procedure [message #38264] Fri, 05 April 2002 06:48 Go to next message
Bill Trowsdale
Messages: 9
Registered: April 2002
Junior Member
Hi,

consider the following procedure:

procedure example (a in varchar2, b in varchar2, c in varchar2) is........

if I call the procedure and want "c" to receive a null
parameter, I could code the following:

execute example('value1','value2',null);

Is there a way to code the procedure so that it will
assume that if only two values are passed to it, the
third value should be null?

For example, say I coded:

execute example('value1','value2');

In this case, I would want "example" to know that the
value for "c" is supposed to be null, even though I
didn't explicitly send the value "null" in the procedure
call.

Any suggestions? I think C+ allows something like
this, but I don't know about Oracle....

Thanks.
Re: null parameters in a PL/SQL procedure [message #38266 is a reply to message #38264] Fri, 05 April 2002 07:35 Go to previous message
Todd Barry
Messages: 4819
Registered: August 2001
Senior Member
procedure example (a in varchar2, b in varchar2, c in varchar2 default null)


or

procedure example (a in varchar2, b in varchar2, c in varchar2 := null)
Previous Topic: How can i get the content of procudure from sqlplus?
Next Topic: User_objects
Goto Forum:
  


Current Time: Tue Mar 19 05:30:34 CDT 2024