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

Home -> Community -> Usenet -> c.d.o.server -> Re: Returning a ResultSet from a stored procedure

Re: Returning a ResultSet from a stored procedure

From: Joseph Weinstein <joe_at_weblogic.com>
Date: Tue, 28 Sep 1999 16:34:57 -0700
Message-ID: <37F150A1.D390E716@weblogic.com>


"Alex A." wrote:

> Hi.
>
> Is there a way to return a ResultSet from a stored procedure/function?
> The only way I know of (in Oracle) is to have the stored function return
> a reference to a cursor (REF CURSOR) and the Java client register the
> return type as OracleTypes.CURSOR which can then be casted to a
> ResultSet. But this uses Oracle specific stuff in the client. Is there
> another way to do it?

No. Oracle itself can only return result sets from a 'naked' query, or via a cursor as a stored procedure output parameter. The latter is not available from standard JDBC, only the extension to JDBC, CallableStatement.getResultSet(int paramindex) available from Oracle drivers.

   Other DBMSes can return one or more resultsets 'inline', as resultsets from a Statement after the execute() of a given stored procedure, via standard JDBC calls to getNextResult(), and getResultSet(). MS SQLServer and Sybase are examples.

Joe Weinstein at BEA< the home of WebLogic --
PS: Hey folks, we're hiring Java engineers for our WebLogic

    Engineering group in downtown S.F. Send me your resume.


                    The Weblogic Application Server from BEA
         JavaWorld Editor's Choice Award: Best Web Application Server
  Java Developer's Journal Editor's Choice Award: Best Web Application Server
     Crossroads A-List Award: Rapid Application Development Tools for Java
Intelligent Enterprise RealWare: Best Application Using a Component Architecture
               http://weblogic.beasys.com/press/awards/index.htm



Received on Tue Sep 28 1999 - 18:34:57 CDT

Original text of this message

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