you need to add the
<selectKey resultClass="int" keyProperty="id" >
select LAST_INSERT_ID()
</selectKey>
above is for mysql just change to olacle specific code. etcsteve -----Original Message----- From: Steven Pannell [mailto:[EMAIL PROTECTED] Sent: Thu 3/17/2005 3:52 PM To: '[email protected]' Subject: Getting the generate primary key Hi, I want to get the automatically generated key from a newly inserted row (my oracle database handles the generation of the key via a trigger). I followed the docs but it does not appear to be working. SqlMap: <insert id="writeOrder" parameterClass="Order" > INSERT INTO ORDERS(order_price) values(#orderPrice#) </insert> Code: Long id = (Long)client.insert(new SqlMapId("writeOrder"),order); The returned value is always null. but I want the primary key id. am I doing anything wrong here (using ibatis 2.0.9.496) I'm sure when i tried this on an earlier version if iBatis it was working. Thanks, Steve. This e-mail and any attachment is for authorised use by the intended recipient(s) only. It may contain proprietary material, confidential information and/or be subject to legal privilege. It should not be copied, disclosed to, retained or used by, any other party. If you are not an intended recipient then please promptly delete this e-mail and any attachment and all copies and inform the sender. Thank you.
<<winmail.dat>>

