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

Home -> Community -> Usenet -> c.d.o.misc -> Re: Tracing ref_cursors

Re: Tracing ref_cursors

From: Thomas Kyte <tkyte_at_us.oracle.com>
Date: 7 Dec 2001 15:57:34 -0800
Message-ID: <9url1e0ggm@drn.newsguy.com>


In article <18b0424d.0112061515.2810f31d_at_posting.google.com>, manish.shah_at_emagine-int.com says...
>
>>You need to invoke the plsql from java, not have the plsql invoke the java, in
>> this case.
>
>I'm not sure I understood your response.
>
>My requirement is:
>
>I'd like to write a stored proc that takes any ref_cursor and prints
>out its contents to dbms_output.
>
>Since PL/SQL cannot do this, I thought maybe I could pass the
>ref_cursors to a Java class that can. You say that this is not
>possible, so it would seem that my requirement cannot be fulfilled.
>

PLSQL cannot pass a ref cursor to java.

Java can call PLSQL, get a ref cursor cursor BACK and print it out.

So, you need to invoke the plsql from java.

You can write a very simple test harness that calls the PLSQL from a java client, and dumps the cursor out. that is what I was trying to say.

>Cheers,
>Manish
>
>
>
>Thomas Kyte <tkyte_at_us.oracle.com> wrote in message
>news:<9unmf302tdo_at_drn.newsguy.com>...
>> In article <18b0424d.0112051859.2a05f067_at_posting.google.com>,
>> manish.shah_at_emagine-int.com says...
>> >
>> >Hi,
>> >
>> >I call a lot of PL/SQL stored procs that return ref_cursors, from a
>> >Java application server.
>> >
>> >To help me debug, I'd like to write a stored proc that takes any
>> >ref_cursor and prints out its contents to dbms_output.
>> >
>> >The dba's said it was not possible to do this in PL/SQL,
>>
>> thats correct
>>
>> >so I wrote a
>> >Java class to do it instead -
>> >
>> >public class Tracer {
>> >
>> > public static void traceResultSet(ResultSet rs);
>> >
>> >}
>> >
>> >I can't work out how to call this from PL/SQL and pass in a
>> >ref_cursor. Any help appreciated.
>> >
>>
>>the java must call the plsql -- the java can get the ref cursor BACK, it cannot
>> get the ref cursor passed to it.
>>
>>You need to invoke the plsql from java, not have the plsql invoke the java, in
>> this case.
>>
>> >Cheers,
>> >Manish

--
Thomas Kyte (tkyte@us.oracle.com)             http://asktom.oracle.com/ 
Expert one on one Oracle, programming techniques and solutions for Oracle.
http://www.amazon.com/exec/obidos/ASIN/1861004826/  
Opinions are mine and do not necessarily reflect those of Oracle Corp 
Received on Fri Dec 07 2001 - 17:57:34 CST

Original text of this message

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