Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: use an array as input parameter for procedure
"Mariano" <mariano.calandra_at_gmail.com> a écrit dans le message de news: 1182606785.877789.107950_at_m36g2000hse.googlegroups.com...
|I need to create a procedure that accept as input parameter an array
| of integer, how can realize it?
|
| PROCEDURE add_allPaz( ??? ) AS
| BEGIN
| // understand how many elements there are in array
| END;
|
| What should I use at place of ???
|
SQL> create or replace type my_array is table of number 2 /
Type created.
SQL> create or replace procedure p (p my_array)
2 is
3 begin
4 for i in p.first..p.last loop
5 dbms_output.put_line('p('||i||')='||p(i));
6 end loop;
7 end;
8 /
Procedure created.
SQL> exec p(my_array(1,4,7,19,5));
p(1)=1 p(2)=4 p(3)=7 p(4)=19 p(5)=5
PL/SQL procedure successfully completed.
Regards
Michel Cadot
Received on Sat Jun 23 2007 - 10:04:06 CDT