Return-Path: Delivered-To: apmail-db-derby-dev-archive@www.apache.org Received: (qmail 32586 invoked from network); 2 Feb 2009 19:28:27 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 2 Feb 2009 19:28:27 -0000 Received: (qmail 1336 invoked by uid 500); 2 Feb 2009 19:28:21 -0000 Delivered-To: apmail-db-derby-dev-archive@db.apache.org Received: (qmail 1249 invoked by uid 500); 2 Feb 2009 19:28:20 -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 1202 invoked by uid 99); 2 Feb 2009 19:28:20 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 02 Feb 2009 11:28:20 -0800 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.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 02 Feb 2009 19:28:20 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id EADFC234C4CA for ; Mon, 2 Feb 2009 11:27:59 -0800 (PST) Message-ID: <1594000274.1233602879961.JavaMail.jira@brutus> Date: Mon, 2 Feb 2009 11:27:59 -0800 (PST) From: "Knut Anders Hatlen (JIRA)" To: derby-dev@db.apache.org Subject: [jira] Commented: (DERBY-4045) Subquery causes error: 'updateString' not allowed because the ResultSet is not an updatable ResultSet In-Reply-To: <1539993469.1233588959947.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/DERBY-4045?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12669710#action_12669710 ] Knut Anders Hatlen commented on DERBY-4045: ------------------------------------------- I tried to remove the check, and the query in the description of the issue worked fine, and I could use positioned updates on the cursor. However, with other queries it failed when I tried to do the positioned update: ij> get cursor c as 'select * from t1 where x in (select x from t1) for update'; ij> next c; X |Y ---------------------- 1 |one ij> next c; X |Y ---------------------- 2 |two ij> update t1 set y = 'asdfa' where current of c; ERROR XJ001: Java exception: 'ASSERT FAILED Join used in positioned update/delete: org.apache.derby.shared.common.sanity.AssertFailure'. So the problem with subqueries in WHERE clauses appears to be that the optimizer may choose to rewrite the query to a join, and Derby doesn't have updatable joins. > Subquery causes error: 'updateString' not allowed because the ResultSet is not an updatable ResultSet > ----------------------------------------------------------------------------------------------------- > > Key: DERBY-4045 > URL: https://issues.apache.org/jira/browse/DERBY-4045 > Project: Derby > Issue Type: Bug > Components: Documentation, SQL > Reporter: John T. Dow > > Embedded Derby (don't know about client) demoted an updatable result set apparently due to a nested query. > select * from orders where (orders.recordno = (select max(orders.recordno) from orders)) > Fix if possible. > If it can't be fixed, the documentation should be changed. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.