Home » RDBMS Server » Server Administration » Passing a table (array) into a procedure
Passing a table (array) into a procedure [message #372354] Mon, 05 February 2001 06:36 Go to next message
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 #372358 is a reply to message #372354] Mon, 05 February 2001 09:00 Go to previous messageGo to next message
Lee
Messages: 56
Registered: May 1999
Member
Procedure da_da_da (Fix_name_table in Route_Table_T);
Re: Passing a table (array) into a procedure [message #372364 is a reply to message #372354] Mon, 05 February 2001 10:11 Go to previous message
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
Previous Topic: modify composite keys
Next Topic: Replication Software
Goto Forum:
  


Current Time: Fri Jun 28 16:49:36 CDT 2024