Return-Path: Delivered-To: apmail-ibatis-user-java-archive@www.apache.org Received: (qmail 72560 invoked from network); 15 Sep 2006 11:58:17 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 15 Sep 2006 11:58:17 -0000 Received: (qmail 8577 invoked by uid 500); 15 Sep 2006 11:58:15 -0000 Delivered-To: apmail-ibatis-user-java-archive@ibatis.apache.org Received: (qmail 8568 invoked by uid 500); 15 Sep 2006 11:58:14 -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 8557 invoked by uid 99); 15 Sep 2006 11:58:14 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 15 Sep 2006 04:58:14 -0700 X-ASF-Spam-Status: No, hits=1.1 required=10.0 tests=DNS_FROM_RFC_ABUSE,HTML_00_10,HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: domain of dyhodge@gmail.com designates 64.233.162.195 as permitted sender) Received: from [64.233.162.195] (HELO nz-out-0102.google.com) (64.233.162.195) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 15 Sep 2006 04:58:05 -0700 Received: by nz-out-0102.google.com with SMTP id n1so1347988nzf for ; Fri, 15 Sep 2006 04:57:39 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:mime-version:content-type; b=gzbplgyh6Oj1d30MnTqcIP11hXRaawMRFlk2aLuxqw0CRsxT3LopznT7tAkEPpts5QH7wilmAHbUM9Hnz1uPm4zhmRzh1g3UBw67DOESxFM3CyvD2CpcWYOTmk2uxF5A/BhJY0cxrzfsQpd3NhYm5wT2IEoEmo6QjIKd66vgSFM= Received: by 10.35.15.11 with SMTP id s11mr17122661pyi; Fri, 15 Sep 2006 04:57:39 -0700 (PDT) Received: by 10.35.116.19 with HTTP; Fri, 15 Sep 2006 04:57:38 -0700 (PDT) Message-ID: <4bb374d70609150457i3332fe0dtd6b8d95b730a1c61@mail.gmail.com> Date: Fri, 15 Sep 2006 07:57:38 -0400 From: "David Hodge" To: user-java@ibatis.apache.org Subject: Obtaining Generated Primary Keys MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_29753_22147296.1158321458971" X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N ------=_Part_29753_22147296.1158321458971 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline I am using Oracle and I am wondering if there is a way to obtain a trigger generated Primary key after doing an INSERT with iBatis. I know there is a selectKey function but that seems to work only if you have a select statement, which makes sense. Other databases have ways for you to select the last_generated_id() but I do not think Oracle has this capability. Has anyone else had this problem or know of a work around? Thanks, David Y. Hodge ------=_Part_29753_22147296.1158321458971 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline I am using Oracle and I am wondering if there is a way to obtain a trigger generated Primary key after doing an INSERT with iBatis.

I know there is a selectKey function but that seems to work only if you have a select statement, which makes sense.  Other databases have ways
for you to select the last_generated_id() but I do not think Oracle has this capability.

Has anyone else had this problem or know of a work around?


Thanks,

David Y. Hodge
------=_Part_29753_22147296.1158321458971--