Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> RE: ** pass table in a script to execute PL/SQL (procedure)

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

From: <Katz.C_at_forces.gc.ca>
Date: Mon, 18 Oct 2004 11:06:45 -0400
Message-Id: <20041018150843.285522AB602@mx04.forces.gc.ca>


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.                     



Do you Yahoo!?
Yahoo! Mail Address AutoComplete - You start. We finish.

--

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

http://www.freelists.org/webpage/oracle-l Received on Mon Oct 18 2004 - 10:02:16 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US