ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Beary, Nick (EHQ)" <NBe...@express-scripts.com>
Subject Insert statement returns generated key
Date Fri, 28 Aug 2009 14:56:16 GMT
Hello, I looked around for an answer to this but didn't see anything.  To insert objects in
our database, I have to use a macro that returns the key of the newly inserted object.  This
means that the entirety of my insert statement is located in the selectKey section.  Because
an SQL statement is required in the PCDATA section outside of <selectKey>, I just put
a ; there.  So it looks like this:

<insert id="insert-xxx" parameterClass="xxx">
<selectKey resultClass="int" keyProperty="ID">
                exec insert_macro(...)

Does anybody know a more elegant/less hacky solution to this?

We are using Teradata 12.0.


View raw message