RE: ** pass table in a script to execute PL/SQL (procedure)

  • From: Katz.C@xxxxxxxxxxxx
  • To: ajoshi977@xxxxxxxxx, oracle-l@xxxxxxxxxxxxx
  • Date: Mon, 18 Oct 2004 11:06:45 -0400

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@xxxxxxxxx]
Sent: Friday, October 15, 2004 3:30 PM
To: oracle-l@xxxxxxxxxxx
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. 
 
 
                
---------------------------------
Do you Yahoo!?
Yahoo! Mail Address AutoComplete - You start. We finish.

--
//www.freelists.org/webpage/oracle-l
--
//www.freelists.org/webpage/oracle-l

Other related posts: