Return-Path: Delivered-To: apmail-ibatis-user-java-archive@www.apache.org Received: (qmail 94710 invoked from network); 20 May 2009 19:25:52 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 20 May 2009 19:25:52 -0000 Received: (qmail 74505 invoked by uid 500); 20 May 2009 19:26:04 -0000 Delivered-To: apmail-ibatis-user-java-archive@ibatis.apache.org Received: (qmail 74489 invoked by uid 500); 20 May 2009 19:26:04 -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 74481 invoked by uid 99); 20 May 2009 19:26:03 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 20 May 2009 19:26:03 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of lists@nabble.com designates 216.139.236.158 as permitted sender) Received: from [216.139.236.158] (HELO kuber.nabble.com) (216.139.236.158) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 20 May 2009 19:25:53 +0000 Received: from isper.nabble.com ([192.168.236.156]) by kuber.nabble.com with esmtp (Exim 4.63) (envelope-from ) id 1M6rPw-0006My-52 for user-java@ibatis.apache.org; Wed, 20 May 2009 12:25:32 -0700 Message-ID: <23641858.post@talk.nabble.com> Date: Wed, 20 May 2009 12:25:32 -0700 (PDT) From: "m.montano" To: user-java@ibatis.apache.org Subject: Help with identity MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Nabble-From: koalina82@gmail.com X-Virus-Checked: Checked by ClamAV on apache.org Hi all, i'm a newbie in ibatis... I'm working on MS sql server 2000, driver jtds. The problem is: I have this transaction to execute begin transaction declare @id_audio varchar(20) set @id_a = cast(IDENT_CURRENT('file') + ident_incr('file') as varchar) INSERT INTO FILEMD (furl, F1, F2, IDA) VALUES ('val furl', 'val f1', 'val f2', @id_a) INSERT INTO ANNUNCI (idann, F3, F4, ida) VALUES ('val idann', 'val f3', 'valore f4', @id_a) commit transaction GO I'm trying with: //begin transaction sqlMap.startTransaction(); int idAudio = 000;//to retrieve + increment ...how? amdr.setIdAudio(idAudio ); sqlMap.insert("insertFileMD", amdr); ann.setIdAudio(idAudio ); sqlMap.insert("insertAnnuncio", ann); sqlMap.commitTransaction(); //commit transaction I'm not sure how to retrieve the idAudio (the identity column in FILEMD)... can please you help me? thanx for support, have a nice day, Michela -- View this message in context: http://www.nabble.com/Help-with-identity-tp23641858p23641858.html Sent from the iBATIS - User - Java mailing list archive at Nabble.com.