ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From reub...@sonic.net
Subject Re: Sybase selectKey problem
Date Fri, 07 Oct 2005 01:12:19 GMT
BTW, this *does* work:

    <insert id="createDeployment" parameterClass="deployment">
        <selectKey resultClass="int" keyProperty="deploymentId">
            SELECT MAX(deploymentId) + 1 FROM Deployment

        INSERT INTO Deployment (deploymentId, environmentId,
deploymentTypeId, userName, deploymentStatusId, deploymentTime,
        VALUES (#deploymentId#, #environmentId#, #deploymentTypeId#,
                #deploymentStatusId#, #deploymentTime#,

BUT it directly contradicts the thread here:

...in which the consensus that the selectKey operation for sybase is
identical to MSSQL in a) being after the insert and b) using @@IDENTITY.
Also it would seem to be counter to the examples in the docs, which don't
require that "deploymentId" be explicity passed to the insert.

What am I missing? Are these differences due to which JDBC driver I'm
using? (Jconn3)

#2 (below) still stands.


> #2 -- Given that the insert/update statements are very much alike, is
> there a clean way to share the SQL between the two?

View raw message