Passing a table (array) into a procedure [message #372354] |
Mon, 05 February 2001 06:36 |
Josh
Messages: 9 Registered: August 1999
|
Junior Member |
|
|
I have a table declared in one procedure. I populate this table then calls another procedure that needs the values in the table.
What type do I use in the procedure declaration?
Table is:
Type Route_Table_T is table of varchar2(12);
Fix_Name Route_Table_T;
I need to pass Fix_name into a procedure so what's the data type?
Procedure da_da_da (Fix_name_table in ?????) is
begin
NULL;
end da_da_da;
|
|
|
|
Re: Passing a table (array) into a procedure [message #372364 is a reply to message #372354] |
Mon, 05 February 2001 10:11 |
Suresh Vemulapalli
Messages: 624 Registered: August 2000
|
Senior Member |
|
|
hi,
what ever you declare pl/sql table in procedure is local to that procedure..so, create package and delcare pl/sql type in that package specification part...
e.g:
create or replace package pkg1 is
type mytbl is table of varchar2(100) index by binary_integer;
end;
now you can use above pl/sql table in stored procedure
create or replace procedure procname is
myreftbl pkg1.mytbl;
begin
--build nyreftbl with values
proc1(myreftbl);
end;
create or replace procedure procname(plsqltbl in pkg1.mytbl) is
begin
...stmts
end;
Suresh
|
|
|