ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Rashid Jilani" <jil...@lifebiosystems.com>
Subject reading an identity column and inserting it in to other table
Date Mon, 23 Feb 2009 20:23:44 GMT
Hi: guys can some one shed some light how to read an identity column in
mysql and update the other table with the identity value.

 

E.g  <insert id="inseretIntoUser"
parameterClass="com.lifebiosystems.domain.RegisteredUser">

        INSERT INTO address(zip, country)

        VALUES(#address.zip#, #address.country#)

        <selectKey resultClass="int" >

            SELECT @@IDENTITY AS id

        </selectKey>

    </insert>

 

I am not sure how to read the value of id and use in a different insert
statement

 

Thanks,

RJ


Mime
View raw message