ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From xianwinwin <xianwin...@gmail.com>
Subject Re: get id with iBatis (Statement.RETURN_GENERATED_KEYS)
Date Tue, 16 May 2006 18:26:13 GMT

thank you for your reply Jeff.

I looked at the documentation and tried (unsuccessfully) some of the
examples.

I tried somthing that looks like this:
<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE sql-map
   PUBLIC "-//iBATIS.com//DTD SQL Map 1.0//EN"
   "http://www.ibatis.com/dtd/sql-map.dtd">

<sql-map name="Organizations">
  
<insert id="InsertOrganization" parameterClass="Organization"
resultClass="int">
	<selectKey property="Id" type="post" resultClass="int">
		SELECT LAST_INSERT_ID() AS value
	</selectKey>			
	INSERT INTO Organizations
		(Org_Code, Org_Name) 
	VALUES 
		(#Code#, #Name#)
</insert>
   
</sql-map>  


I keep getting the following error cause: Element "sqlMap" requires
additional elements.
any idea?

--
View this message in context: http://www.nabble.com/get-id-with-iBatis-%28Statement.RETURN_GENERATED_KEYS%29-t1629789.html#a4415947
Sent from the iBATIS - User - Java forum at Nabble.com.


Mime
View raw message