Return-Path: Delivered-To: apmail-db-derby-user-archive@www.apache.org Received: (qmail 10072 invoked from network); 13 May 2005 16:50:07 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 13 May 2005 16:50:07 -0000 Received: (qmail 16442 invoked by uid 500); 13 May 2005 16:53:46 -0000 Delivered-To: apmail-db-derby-user-archive@db.apache.org Received: (qmail 16368 invoked by uid 500); 13 May 2005 16:53:46 -0000 Mailing-List: contact derby-user-help@db.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: List-Id: Reply-To: "Derby Discussion" Delivered-To: mailing list derby-user@db.apache.org Received: (qmail 16328 invoked by uid 99); 13 May 2005 16:53:45 -0000 X-ASF-Spam-Status: No, hits=0.3 required=10.0 tests=FORGED_RCVD_HELO,UPPERCASE_25_50 X-Spam-Check-By: apache.org Received-SPF: neutral (hermes.apache.org: local policy) Received: from adsl-64-174-44-82.dsl.snfc21.pacbell.net (HELO itsy.pauljlucas.org) (64.174.44.82) by apache.org (qpsmtpd/0.28) with ESMTP; Fri, 13 May 2005 09:53:44 -0700 Received: from itsy.pauljlucas.org (SouthBay@localhost.localdomain [127.0.0.1]) by itsy.pauljlucas.org (8.13.3/8.13.3/Debian-6) with ESMTP id j4DGnKKf013363 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT) for ; Fri, 13 May 2005 09:49:20 -0700 Received: from localhost (pjl@localhost) by itsy.pauljlucas.org (8.13.3/8.13.3/Submit) with ESMTP id j4DGnFsd013358 for ; Fri, 13 May 2005 09:49:20 -0700 X-Authentication-Warning: itsy.pauljlucas.org: pjl owned process doing -bs Date: Fri, 13 May 2005 09:49:15 -0700 (PDT) From: "Paul J. Lucas" X-X-Sender: pjl@itsy.pauljlucas.org To: Derby Discussion Subject: Re: Atomicity of using IDENTITY_VAL_LOCAL() In-Reply-To: <4284CF16.7070603@debrunners.com> Message-ID: References: <4284CF16.7070603@debrunners.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Virus-Checked: Checked X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N On Fri, 13 May 2005, Daniel John Debrunner wrote: > So I think the answer to Paul's question is not answered by that > documentation. Right. > Does it mean the most recent INSERT for that connection or the most > recent insert to the database. What about the most recent insert for a table? Does: SELECT IDENTITY_VAL_LOCAL() FROM mytable1; really only return IDENTITY_VAL_LOCAL() for *that* table or is the above deceptively equivalent to: VALUES IDENTITY_VAL_LOCAL(); ? More explicitly, if I do: INSERT INTO mytable1 ... ; INSERT INTO mytable2 ... ; SELECT IDENTITY_VAL_LOCAL() FROM mytable1; SELECT IDENTITY_VAL_LOCAL() FROM mytable2; where both tables have an IDENTITY column, so I get the correct values back from both selects? - Paul