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: variable list of arguments to a pl/sql procedure

Re: variable list of arguments to a pl/sql procedure

From: Dmitry E. Loginov <lde_at_mpsb.ru>
Date: Fri, 10 Jun 2005 20:41:09 +0400
Message-ID: <d8cfp4$3bs$1@news.caravan.ru>


"Oxnard" <shankeypNO_SPAM_at_comcast.net> wrote in message news:D-OdnQBEMoDjADTfRVn-uQ_at_comcast.com...
> ver 9.2.0.5
>
> I think I can overload a procedure but the variable list could be between
1
> and a couple 100, so that's not a good option.
>
> I am thinking about bringing the list in as a string then parsing it. and
> creating a varry or something like that.
>
> I would like some comments from others who have had to deal with simular
> issues.

You can try something like:

SQL> CREATE OR REPLACE TYPE TSTRINGSTBL AS TABLE OF VARCHAR2(2000)   2 /
Type created.

SQL> create or replace procedure TestVarArg(Args TStringsTbl) is   2 begin
  3 for i in Args.First..Args.Last loop   4 dbms_output.put_line('Args('||i||')='||Args(i));   5 end loop;
  6 end;
  7 /
Procedure created.

SQL> begin
  2 TestVarArg(TStringsTbl('One','Two','Three'));   3 end;
  4 /

Args(1)=One
Args(2)=Two
Args(3)=Three

PL/SQL procedure successfully completed.

Dmitry Received on Fri Jun 10 2005 - 11:41:09 CDT

Original text of this message

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