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: steve <E_at_E.COM>
Date: Thu, 13 Dec 2001 06:26:56 +0800
Message-ID: <1f4ccbl.hiwoqiuqovowN%E@E.COM>


why can sql not pass a ref cursor back to java? below i have java code that calls an pl/SQL procedure

procedure (xyz out ref_table, dummy1 in varchar2, dummy2 in varchar2); open xyz select * from table.
return

                
         String The_qry="{call external_user.PACKAGE_01.GET_NOTE(?,"+
"'"+ caf_pointer.trim()+
"','"+"NOTHING"+                //OUR SECURITY KEY GOES HERE
"')}";                  

  cstmt=(OracleCallableStatement)my_vars.dbconn.prepareCall(The_qry);    cstmt.registerOutParameter(1,OracleTypes.CURSOR);    cstmt.execute();
    // Get the return value and covert it into a JDBC STRING

      
/*      
 
 rset = (ResultSet)cstmt.getObject(1);
        display( rset );







Thomas Kyte <tkyte_at_us.oracle.com> wrote:

> 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 javain
> >> 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.
>
Received on Wed Dec 12 2001 - 16:26:56 CST

Original text of this message

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