It might work.

I don't think I am doing anything oracle specific (other than looking for an out parameter of type ORACLECURSOR).

The oracle JDBC driver returns the RefCursor as a resultset which I can access via resultset.getObject(). I don't know how you access the RefCursor from the postgres JDBC driver.

Regards,
Mike Fagan


March, Andres wrote:

I have been looking for a way to do this for postgres.  Is this feature only available for the Oracle RefCursor type or can it be used with other databases?

 


From: Mike Fagan [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, February 01, 2006 8:41 AM
To: [email protected]
Subject: Re: calling stored functions

 

Here is a sample that will take the refcursor and map it automatically to your resultMap - No TypeHandler required.

<resultMap id="myResultMap" class="MyClass" >
    <result property="id" column="RECORD_ID" />
    <result property="name" column="NAME" />
    <result property="address" column="ADDRESS" />
 </resultMap>

 <parameterMap id="myParamMap" class="map" >
       <parameter property="result" jdbcType="ORACLECURSOR" mode="OUT"/>
       <parameter property="userId" jdbcType="NUMERIC" mode="IN"/>
 </parameterMap>

<procedure id="mycursorfunction" parameterMap="myParamMap" resultMap="myResultMap" >
        { ? = call myRefCursorFunction(? ) }
 </procedure>

Regards,
Mike Fagan

bob robertson wrote:

 

which seems to be a great solution to using ref cursors.

 

Is it possible to call a stored function instead of a stored procedure, and to obtain the cursor as a return value rather than an OUT parameter.

 

Maybe it sounds like I'm being picky, but you know, existing schemas, no permissions on DB etc etc blah blah blah.

 

Thanks.


Telefonieren Sie ohne weitere Kosten mit Ihren Freunden von PC zu PC!
Jetzt Yahoo! Messenger installieren!

 


Reply via email to