Being Oracle-challanged myself, I approached my friendly DBA with the problem. I was told that a different function call was used for the same purposed and called after the insert. Perhaps each Oracle shop has their own such function. So I modified the name and flipped the order of my insert statement and key like this.

<insert id="addProduct" parameterClass="xyz.ProductEntityBean">
insert into mrt_product (COMPANY_ID, DIVISION_ID, UPC_NO)
values (#companyId#, #divisionId#, #upcNo#)
<selectKey keyProperty="uniqueProductId" resultClass="long">
select pkg_sequence.f_read_sequence_value() as id from dual
</selectKey>
</insert>


After my call to addProduct, my object has the uniqueProductId field populated.

Paul

Reply via email to