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 GD...@cofidis.fr on 2005/05/03 16:21:38 UTC
problem with Selectkey
Hi,
I have to insert a new record using 2 sequences values (oracle).
So my code is :
<insert id="INSERT_SESSION_HTTP_COOKIE" parameterClass=
"mypackage.commun.dataobject.DoSessionHttp">
<selectKey resultClass="int" keyProperty="codesession">
select SQ_CODE_SESSION.nextval AS CODESESSION from
dual
</selectKey>
<selectKey resultClass="string" keyProperty="codecookie">
select SQ_CODE_COOKIE.nextval AS CODECOOKIE from
dual
</selectKey>
insert into SESSION_HTTP (codeSession, codeCookie,
numClient)
values (#codesession#, #codecookie#, #numclient#)
</insert>
But the problem is that the second selectkey isn't executing. Why ? Is it
a limitation of ibatis ?
How can i solve my problem ?
Thanks for your help.
G.D.
Re: problem with Selectkey
Posted by Larry Meadors <la...@gmail.com>.
Yes, currently, only one selectKey is allowed in an insert.
Larry
On 5/3/05, GDUHAMEL@cofidis.fr <GD...@cofidis.fr> wrote:
>
>
> Hi,
>
> I have to insert a new record using 2 sequences values (oracle).
> So my code is :
>
> <insert id="INSERT_SESSION_HTTP_COOKIE" parameterClass="
> mypackage.commun.dataobject.DoSessionHttp">
> <selectKey resultClass="int" keyProperty="codesession">
> select SQ_CODE_SESSION.nextval AS CODESESSION from dual
> </selectKey>
> <selectKey resultClass="string" keyProperty="codecookie">
> select SQ_CODE_COOKIE.nextval AS CODECOOKIE from dual
> </selectKey>
> insert into SESSION_HTTP (codeSession, codeCookie, numClient)
> values (#codesession#, #codecookie#, #numclient#)
> </insert>
>
> But the problem is that the second selectkey isn't executing. Why ? Is it
> a limitation of ibatis ?
>
> How can i solve my problem ?
>
> Thanks for your help.
>
> G.D.