ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mike Fagan <mfa...@tde.com>
Subject Re: calling stored functions
Date Wed, 01 Feb 2006 16:41:21 GMT
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+REF+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