Return-Path: Delivered-To: apmail-ibatis-user-java-archive@www.apache.org Received: (qmail 86388 invoked from network); 20 Aug 2005 02:00:10 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 20 Aug 2005 02:00:10 -0000 Received: (qmail 70805 invoked by uid 500); 20 Aug 2005 02:00:08 -0000 Delivered-To: apmail-ibatis-user-java-archive@ibatis.apache.org Received: (qmail 70788 invoked by uid 500); 20 Aug 2005 02:00:08 -0000 Mailing-List: contact user-java-help@ibatis.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user-java@ibatis.apache.org Delivered-To: mailing list user-java@ibatis.apache.org Received: (qmail 70775 invoked by uid 99); 20 Aug 2005 02:00:08 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 19 Aug 2005 19:00:08 -0700 X-ASF-Spam-Status: No, hits=1.3 required=10.0 tests=DNS_FROM_RFC_ABUSE,HTML_20_30,HTML_MESSAGE,SPF_HELO_FAIL,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: domain of pglezen@us.ibm.com designates 32.97.110.130 as permitted sender) Received: from [32.97.110.130] (HELO e32.co.us.ibm.com) (32.97.110.130) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 19 Aug 2005 19:00:27 -0700 Received: from d03relay04.boulder.ibm.com (d03relay04.boulder.ibm.com [9.17.195.106]) by e32.co.us.ibm.com (8.12.10/8.12.9) with ESMTP id j7K204wh743342 for ; Fri, 19 Aug 2005 22:00:04 -0400 Received: from d03av01.boulder.ibm.com (d03av01.boulder.ibm.com [9.17.195.167]) by d03relay04.boulder.ibm.com (8.12.10/NCO/VERS6.7) with ESMTP id j7K209wi220012 for ; Fri, 19 Aug 2005 20:00:09 -0600 Received: from d03av01.boulder.ibm.com (loopback [127.0.0.1]) by d03av01.boulder.ibm.com (8.12.11/8.13.3) with ESMTP id j7K203RZ026211 for ; Fri, 19 Aug 2005 20:00:03 -0600 Received: from d03nm120.boulder.ibm.com (d03nm120.boulder.ibm.com [9.17.195.146]) by d03av01.boulder.ibm.com (8.12.11/8.12.11) with ESMTP id j7K203xm026206 for ; Fri, 19 Aug 2005 20:00:03 -0600 Subject: Re: selectKey with Oracle (resolved) To: user-java@ibatis.apache.org X-Mailer: Lotus Notes Release 6.0.2CF1 June 9, 2003 Message-ID: From: Paul Glezen Date: Fri, 19 Aug 2005 18:58:40 -0700 X-MIMETrack: Serialize by Router on D03NM120/03/M/IBM(Release 6.5.4|March 27, 2005) at 08/19/2005 20:00:10 MIME-Version: 1.0 Content-type: multipart/alternative; Boundary="0__=07BBFAF0DF9A32D28f9e8a93df938690918c07BBFAF0DF9A32D2" Content-Disposition: inline X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N --0__=07BBFAF0DF9A32D28f9e8a93df938690918c07BBFAF0DF9A32D2 Content-type: text/plain; charset=US-ASCII Content-transfer-encoding: quoted-printable Being Oracle-challanged myself, I approached my friendly DBA with the problem. I was told that a different function call was used for the sa= me purposed and called after the insert. Perhaps each Oracle shop has the= ir own such function. So I modified the name and flipped the order of my insert statement and key like this. insert into mrt_product (COMPANY_ID, DIVISION_ID, UPC_NO) values (#companyId#, #divisionId#, #upcNo#) select pkg_sequence.f_read_sequence_value() as id from dual After my call to addProduct, my object has the uniqueProductId field populated. Paul= --0__=07BBFAF0DF9A32D28f9e8a93df938690918c07BBFAF0DF9A32D2 Content-type: text/html; charset=US-ASCII Content-Disposition: inline Content-transfer-encoding: quoted-printable

Being Oracle-challanged myself, I approac= hed my friendly DBA with the problem. I was told that a different func= tion call was used for the same purposed and called after the insert. = Perhaps each Oracle shop has their own such function. So I modified th= e name and flipped the order of my insert statement and key like this.<= /font>

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


After my call to addProduct, my object has t= he uniqueProductId field populated.

Paul
= --0__=07BBFAF0DF9A32D28f9e8a93df938690918c07BBFAF0DF9A32D2--