Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Mailing Lists -> Oracle-L -> RE: ** pass table in a script to execute PL/SQL (procedure)
Joshi,
I'm not sure if you already got the answer you're looking for but you're on
the right track. Look up table functions in the pl/sql 9i docs. (I'm not
sure about previous versions). You can output a table by creating a function
which returns the specific table type.
You can pass a table (a query) to the function as well:
The syntax is something like:
create function x (t_inp in sys_refcursor)
return t_tbl
You call it from sql like this:
select *
from table(x (cursor select * from whatever) )
hth
chaim
-----Original Message-----
From: A Joshi [mailto:ajoshi977_at_yahoo.com]
Sent: Friday, October 15, 2004 3:30 PM
To: oracle-l_at_freelists.o
Subject: ** pass table in a script to execute PL/SQL (procedure)
Hi,
I am looking for a way to pass table to a SP as input in a test script
like I pass number, varchar2 fields.
I defined the table as input to the SP as follows:
create type t_type (a number(10), b varchar2(10), c number(2));
create type t_tbl as table of t_type;
procedure (t_tbl_inp in t_tbl,
t_tbl_out out t_tbl, ind out number);
I would like to pass the input parameter t_tbl_inp to the SP and then look at the output t_tbl_out.
Thanks for your help.
--
http://www.freelists.org/webpage/oracle-l
--
http://www.freelists.org/webpage/oracle-l
Received on Mon Oct 18 2004 - 10:02:16 CDT
![]() |
![]() |