ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "March, Andres" <ama...@soe.sony.com>
Subject RE: calling stored functions
Date Wed, 01 Feb 2006 17:37:16 GMT
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:mfagan@tde.com] 
Sent: Wednesday, February 01, 2006 8:41 AM
To: user-java@ibatis.apache.org
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: 

 

Just read
http://opensource2.atlassian.com/confluence/oss/display/IBATIS/Oracle+RE
F+CURSOR+Solutions

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 <http://de.messenger.yahoo.com>  installieren! 

 


Mime
View raw message