Return-Path: Delivered-To: apmail-db-derby-dev-archive@www.apache.org Received: (qmail 65716 invoked from network); 22 Sep 2010 00:54:57 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 22 Sep 2010 00:54:57 -0000 Received: (qmail 12419 invoked by uid 500); 22 Sep 2010 00:54:57 -0000 Delivered-To: apmail-db-derby-dev-archive@db.apache.org Received: (qmail 12397 invoked by uid 500); 22 Sep 2010 00:54:57 -0000 Mailing-List: contact derby-dev-help@db.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: Delivered-To: mailing list derby-dev@db.apache.org Received: (qmail 12390 invoked by uid 99); 22 Sep 2010 00:54:57 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 22 Sep 2010 00:54:57 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.22] (HELO thor.apache.org) (140.211.11.22) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 22 Sep 2010 00:54:54 +0000 Received: from thor (localhost [127.0.0.1]) by thor.apache.org (8.13.8+Sun/8.13.8) with ESMTP id o8M0sXWP027265 for ; Wed, 22 Sep 2010 00:54:33 GMT Message-ID: <32477035.331991285116873039.JavaMail.jira@thor> Date: Tue, 21 Sep 2010 20:54:33 -0400 (EDT) From: "DK (JIRA)" To: derby-dev@db.apache.org Subject: [jira] Updated: (DERBY-4803) Sequences do not work in INSERT/SELECT In-Reply-To: <29395385.236091284667174067.JavaMail.jira@thor> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/DERBY-4803?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] DK updated DERBY-4803: ---------------------- Attachment: DerbyTestCase.sql Rick, that was quick! See attached test case. It fails in 10.6.1.0. > Sequences do not work in INSERT/SELECT > -------------------------------------- > > Key: DERBY-4803 > URL: https://issues.apache.org/jira/browse/DERBY-4803 > Project: Derby > Issue Type: Bug > Components: SQL > Affects Versions: 10.6.1.0 > Environment: Mac OS X, Derby Network Server 10.6.1.0 > Reporter: DK > Assignee: Rick Hillegas > Attachments: derby-4803-01-aa-simpleInsertSelect.diff, DerbyTestCase.sql > > > Using sequence in SELECT works fine whereas the same SELECT query used in INSERT/SELECT results in "The statement references the following sequence more than once" error. This happens even though the SELECT in question returns exactly 1 row of data. > The Reference Manual states 1. " NEXT VALUE FOR expression may occur in the following places: SELECT statement: As part of the expression defining a returned column in a SELECT list" and 2. " NEXT VALUE expression may not appear in any of these situations: CASE expression, WHERE clause, > ORDER BY clause, Aggregate expression, ROW_NUMBER function, DISTINCT select list". > Nowhere a restriction on INSERT/SELECT is mentioned. Additionally, other databases (i.e. Oracle) support use of sequences in INSERT/SELECT. > Therefore, I consider it a bug. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.