ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kris Jenkins <krisajenk...@yahoo.co.uk>
Subject Re: Store procedure
Date Thu, 03 Feb 2005 10:26:46 GMT

>Hi:
>I have a problen when i call a store procedure whith ibatis.
>The store procedure is only for testing and the source is:
>
>CREATE PROCEDURE ptest2
>(@a varchar(20) output,
> @b varchar(20) 
>)
>as
>set @a=@b
>go
>
>The xml code is:
>
><parameterMap id="mapeo" class="map" >
>      <parameter property="a" jdbcType="VARCHAR" javaType="java.lang.String" mode="OUT"/>
>      <parameter property="b" jdbcType="VARCHAR" javaType="java.lang.String" mode="IN"/>
></parameterMap>
>
><procedure id="ptest2"  parameterMap="mapeo" >
>       {? = call ptest2 (?) }
></procedure>
>
>  
>
-->8--

Well, you're calling the procedure as though it were a function.  That's 
bound to cause trouble.  Try something like this:

<procedure id="ptest2"  parameterMap="mapeo" >
       { call ptest2 (?,?) }
</procedure>


And have a look at this wiki entry too: 
http://wiki.apache.org/ibatis/How_20do_20I_20call_20a_20stored_20procedure_3f

HTH,
Kris

-- 
Kris Jenkins
Email:  kris@jenkster.com
Blog:   http://cafe.jenkster.com/
Wiki:   http://wiki.jenkster.com/



Mime
View raw message