Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: How to call Oracle Stored Poc with an array as a param
has been created. */
create or replace package my_package as
/* Define the array type */
type arrayType is table of varchar2(20) index by binary_integer;
/* A couple of procedures to show usage. */
procedure callingProc;
procedure calledProc(parmCount integer, parmArray arrayType);
end my_package;
create or replace package body my_package as
/* The first procedure which fills and passes data */
procedure callingProc is
begin
localArray arrayType;
localArray(1) := 'first'; localArray(2) := 'second'; localArray(3) := 'third'; localArray(4) := 'fourth'; localArray(5) := 'fifth';
calledProc(5,localArray);
end callingProc;
/* This procedure receives the array */
procedure calledProc(parmCount integer, parmArray arrayType) is
begin
/* Loop through the array. In this case, I've passed in the number of * elements but you could do it some other way if needed. */ for index in 1..parmCount loop dbms_output.put_line('First array element says ' ||parmArray(index));
end loop;
end;
end my_package;
HTH, mike
Anthony Smales wrote in message <99ngek$45g$1_at_taliesin.netcom.net.uk>...
>How can I call an Oracle Stored Procedure, if one of the parameters is an
>array?? I need the exact syntax.
>
>Thanks
>
>
Received on Tue Mar 27 2001 - 18:04:08 CST
![]() |
![]() |