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: PL/SQL Arrays

Re: PL/SQL Arrays

From: Richard Kuhler <noone_at_nowhere.com>
Date: Wed, 19 Nov 2003 19:13:39 GMT
Message-ID: <DhPub.90070$Ll5.13201@twister.socal.rr.com>


Jeremy wrote:
> Say you have the following:
>
> typecreate or replace package my_util
> is
> type numarray is table of number index by binary_integer;
> procedure wrap
> (p_numbers in numarray);
> end my_util;
>
> You cannot say "numarray default null" so you are obliged to pass at
> least some parameters to procedure "wrap" when you call it. I am sure
> there is a way around this - how should I define things so that I don't
> have to always pass some value?

I'll mention that if this weren't an index by collection it would be simple. You could do either of these depending on how you wanted it to work ...

procedure wrap (p_numbers in numarray := numarray()); procedure wrap (p_numbers in numarray := null);

With an index by collection, I think you're going to need to overload the procedure. Add a new procedure in addition to the procedure you already have ...

procedure wrap;

then define that procedure body as simply ...

procedure wrap is

   empty_numarray numarray;
begin

   wrap(empty_numarray);
end;

--
Richard
Received on Wed Nov 19 2003 - 13:13:39 CST

Original text of this message

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