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 Folashade Adeyosoye <sh...@gmail.com> on 2006/03/21 19:41:38 UTC

Multiple selectKey in Oracle

Has anyone got this to work for them. I find out that the second selectKey
does not not work too well


<insert id="taskName" parameterClass="objectName">
    <selectKey keyProperty="col1">
          select seq_one from dual
    </selectKey>
    <selectKey keyProperty="col2">
          select seq_two from dual
    </selectKey>

    insert into TABLE_NAME (column1, column2, column3) values (#col1#,
#col2#, #col3#)
</insert>

Re: Multiple selectKey in Oracle

Posted by Sven Boden <li...@pandora.be>.
Because there can only be 1 return value. You can have multiple keys 
generated in Oracle per row, but you can only return one.

Sven

Folashade Adeyosoye wrote:

>Has anyone got this to work for them. I find out that the second selectKey
>does not not work too well
>
>
><insert id="taskName" parameterClass="objectName">
>    <selectKey keyProperty="col1">
>          select seq_one from dual
>    </selectKey>
>    <selectKey keyProperty="col2">
>          select seq_two from dual
>    </selectKey>
>
>    insert into TABLE_NAME (column1, column2, column3) values (#col1#,
>#col2#, #col3#)
></insert>
>
>  
>