Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: Can we pass variable paramaters to a procedure?
> For those of you who are familiar with C programming, you can check the
> number of arguments to a function with the help of argc/argv. I was
> wondering if there is some way to do a similar thing for an Oracle
> procedure?
>
> Can I set the number of parameters that a procedure accepts as variable and
> then within the procedure count the number of actual values entered by the
> user?
Hi,
Yes you can send multiple parameters to a function.
You declare the following in a package:
type vc_arr is table of varchar2(200) index by binary_integer;
then you use this in the procedure you are writing:
create or replace procedure my_proc (parms in package_i_declared_in.vc_arr) as
last_val varchar2(10);
i number default 1;
BEGIN last_val :=parms.count; --this gives you the number of variables
and you access variables like this:
parms(1) etc.
obviously if you wanted the name of the parameter as well you would have two such vraiables one for the name the other for the value.
-----------== Posted via Deja News, The Discussion Network ==---------- http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own Received on Tue Apr 20 1999 - 01:19:41 CDT
![]() |
![]() |