You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user-java@ibatis.apache.org by Debasish Dutta Roy <de...@gmail.com> on 2006/06/14 17:47:14 UTC

Stored Procedure Problem

Dear all
The documentation of SP is so bad it really creates loads of downtime.

Can anyone give me a detailed example of using Stored Procedure. My
requirements...

1. The SP looks like

{?=call test_request.mySP(?,?)}

where 1 = Registered out parameter type INT, 2=In Parameter type INT, 3=Out
Parameter type VARCHAR

I have an object that contains 3 member variables. So in the xml my SP looks
like

{#output1#=call test_request.mySP(#requestId#, #output2#)}

Cannot get to work. Trying out several combinations stupidly.

Has anyone done like this? Urgent...

Re: Stored Procedure Problem

Posted by Debasish Dutta Roy <de...@gmail.com>.
Got it done the 1st way, there was a mistake from my side.

Thanks a lot for the information!!

On 6/14/06, Jeff Butler <je...@gmail.com> wrote:
>
> Two ways to do it.
>
> First way...
>
> <parameterMap id="myParameterMap" class="com.MyClass">
>   <parameter property="output1" jdbcType="INTEGER" mode="OUT" />
>    <parameter property="requestId" jdbcType="INTEGER" mode="IN" />
>   <parameter property="output2" jdbcType="VARCHAR" mode="OUT" />
> </parameterMap>
>
> <procedure id="myProc" parameterMap="myParameterMap">
>   {?=call test_request.mySP(?,?)}
> </procedure>
>
>
> Second way...
>
> <procedure id="myProc" parameterClass="com.MyClass">
>   {#output1,jdbcType=INTEGER,mode=OUT#=call test_request.mySP(
> #requestId,jdbcType=INTEGER,mode=IN#,#output2,jdbcType=VARCHAR,mode=OUT#)}
> </procedure>
>
>
> The first way has been documented for some time.  The second way has been
> available for some time, but only recently documented (see the latest PDF in
> SVN).
>
> Jeff Butler
>
>
>
> On 6/14/06, Debasish Dutta Roy <de...@gmail.com> wrote:
> >
> > Can you please give me your example. That would be really helpful.
> >
> >
> > On 6/14/06, Larry Meadors <lmeadors@apache.org > wrote:
> > >
> > > I have had success using a external resultmap and then using "?"
> > > instead of #property# in the mapped statement.
> > >
> > > Larry
> > >
> > >
> > > On 6/14/06, Debasish Dutta Roy <de...@gmail.com> wrote:
> > > > Dear all
> > > > The documentation of SP is so bad it really creates loads of
> > > downtime.
> > > >
> > > > Can anyone give me a detailed example of using Stored Procedure. My
> > > > requirements...
> > > >
> > > > 1. The SP looks like
> > > >
> > > > {?=call test_request.mySP(?,?)}
> > > >
> > > > where 1 = Registered out parameter type INT, 2=In Parameter type
> > > INT, 3=Out
> > > > Parameter type VARCHAR
> > > >
> > > > I have an object that contains 3 member variables. So in the xml my
> > > SP looks
> > > > like
> > > >
> > > > {#output1#=call test_request.mySP(#requestId#, #output2#)}
> > > >
> > > > Cannot get to work. Trying out several combinations stupidly.
> > > >
> > > > Has anyone done like this? Urgent...
> > > >
> > >
> >
> >
>

Re: Stored Procedure Problem

Posted by Jeff Butler <je...@gmail.com>.
Two ways to do it.

First way...

<parameterMap id="myParameterMap" class="com.MyClass">
  <parameter property="output1" jdbcType="INTEGER" mode="OUT" />
   <parameter property="requestId" jdbcType="INTEGER" mode="IN" />
  <parameter property="output2" jdbcType="VARCHAR" mode="OUT" />
</parameterMap>

<procedure id="myProc" parameterMap="myParameterMap">
  {?=call test_request.mySP(?,?)}
</procedure>


Second way...

<procedure id="myProc" parameterClass="com.MyClass">
  {#output1,jdbcType=INTEGER,mode=OUT#=call test_request.mySP(
#requestId,jdbcType=INTEGER,mode=IN#,#output2,jdbcType=VARCHAR,mode=OUT#)}
</procedure>


The first way has been documented for some time.  The second way has been
available for some time, but only recently documented (see the latest PDF in
SVN).

Jeff Butler



On 6/14/06, Debasish Dutta Roy <de...@gmail.com> wrote:
>
> Can you please give me your example. That would be really helpful.
>
>
> On 6/14/06, Larry Meadors <lmeadors@apache.org > wrote:
> >
> > I have had success using a external resultmap and then using "?"
> > instead of #property# in the mapped statement.
> >
> > Larry
> >
> >
> > On 6/14/06, Debasish Dutta Roy <de...@gmail.com> wrote:
> > > Dear all
> > > The documentation of SP is so bad it really creates loads of downtime.
> >
> > >
> > > Can anyone give me a detailed example of using Stored Procedure. My
> > > requirements...
> > >
> > > 1. The SP looks like
> > >
> > > {?=call test_request.mySP(?,?)}
> > >
> > > where 1 = Registered out parameter type INT, 2=In Parameter type INT,
> > 3=Out
> > > Parameter type VARCHAR
> > >
> > > I have an object that contains 3 member variables. So in the xml my SP
> > looks
> > > like
> > >
> > > {#output1#=call test_request.mySP(#requestId#, #output2#)}
> > >
> > > Cannot get to work. Trying out several combinations stupidly.
> > >
> > > Has anyone done like this? Urgent...
> > >
> >
>
>

Re: Stored Procedure Problem

Posted by Debasish Dutta Roy <de...@gmail.com>.
Can you please give me your example. That would be really helpful.

On 6/14/06, Larry Meadors <lm...@apache.org> wrote:
>
> I have had success using a external resultmap and then using "?"
> instead of #property# in the mapped statement.
>
> Larry
>
>
> On 6/14/06, Debasish Dutta Roy <de...@gmail.com> wrote:
> > Dear all
> > The documentation of SP is so bad it really creates loads of downtime.
> >
> > Can anyone give me a detailed example of using Stored Procedure. My
> > requirements...
> >
> > 1. The SP looks like
> >
> > {?=call test_request.mySP(?,?)}
> >
> > where 1 = Registered out parameter type INT, 2=In Parameter type INT,
> 3=Out
> > Parameter type VARCHAR
> >
> > I have an object that contains 3 member variables. So in the xml my SP
> looks
> > like
> >
> > {#output1#=call test_request.mySP(#requestId#, #output2#)}
> >
> > Cannot get to work. Trying out several combinations stupidly.
> >
> > Has anyone done like this? Urgent...
> >
>

Re: Stored Procedure Problem

Posted by Larry Meadors <lm...@apache.org>.
I have had success using a external resultmap and then using "?"
instead of #property# in the mapped statement.

Larry


On 6/14/06, Debasish Dutta Roy <de...@gmail.com> wrote:
> Dear all
> The documentation of SP is so bad it really creates loads of downtime.
>
> Can anyone give me a detailed example of using Stored Procedure. My
> requirements...
>
> 1. The SP looks like
>
> {?=call test_request.mySP(?,?)}
>
> where 1 = Registered out parameter type INT, 2=In Parameter type INT, 3=Out
> Parameter type VARCHAR
>
> I have an object that contains 3 member variables. So in the xml my SP looks
> like
>
> {#output1#=call test_request.mySP(#requestId#, #output2#)}
>
> Cannot get to work. Trying out several combinations stupidly.
>
> Has anyone done like this? Urgent...
>