Return-Path: Delivered-To: apmail-ibatis-user-java-archive@www.apache.org Received: (qmail 81337 invoked from network); 18 Apr 2008 14:29:51 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 18 Apr 2008 14:29:51 -0000 Received: (qmail 28122 invoked by uid 500); 18 Apr 2008 14:29:49 -0000 Delivered-To: apmail-ibatis-user-java-archive@ibatis.apache.org Received: (qmail 28102 invoked by uid 500); 18 Apr 2008 14:29:49 -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 28091 invoked by uid 99); 18 Apr 2008 14:29:49 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 18 Apr 2008 07:29:49 -0700 X-ASF-Spam-Status: No, hits=1.2 required=10.0 tests=SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (athena.apache.org: local policy) Received: from [64.233.166.181] (HELO py-out-1112.google.com) (64.233.166.181) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 18 Apr 2008 14:29:06 +0000 Received: by py-out-1112.google.com with SMTP id d32so617140pye.21 for ; Fri, 18 Apr 2008 07:29:17 -0700 (PDT) Received: by 10.141.27.16 with SMTP id e16mr1516644rvj.259.1208528956717; Fri, 18 Apr 2008 07:29:16 -0700 (PDT) Received: by 10.141.128.8 with HTTP; Fri, 18 Apr 2008 07:29:16 -0700 (PDT) Message-ID: <5fb0f140804180729x4b23e8ads63a7bfbe557bac49@mail.gmail.com> Date: Fri, 18 Apr 2008 16:29:16 +0200 From: "Chris Marshall" To: user-java@ibatis.apache.org Subject: Re: iBATIS insert does not execute In-Reply-To: <2fe5ef5b0804180610s1746be4fpcab9dbfd04bf630d@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <5fb0f140804180510nd6f3d46yeb715e6a230496ca@mail.gmail.com> <2fe5ef5b0804180610s1746be4fpcab9dbfd04bf630d@mail.gmail.com> X-Virus-Checked: Checked by ClamAV on apache.org Sorry to bug you again but I think that the problem is related to passing a null primary key in the insert statement when the key is autogenerated (by MySQL). What is the best practice here? I have tried the following MySQL specific SqlMap snippet with success, but was hoping for a solution portable among databases: select LAST_INSERT_ID() AS value insert into role (RoleID, ParentID, Name, Notes) values (#roleid:INTEGER#, #parentid:INTEGER#, #name:VARCHAR#, #notes:VARCHAR#) Thanks Chris On 18/04/2008, Brandon Goodin wrote: > Is this the only insert that is not working for you? Do you have others that > are working? What version of iBATIS are you using? > > Brandon Goodin