From derby-user-return-14382-apmail-db-derby-user-archive=db.apache.org@db.apache.org Sat Jun 2 10:19:24 2012 Return-Path: X-Original-To: apmail-db-derby-user-archive@www.apache.org Delivered-To: apmail-db-derby-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 737F1C51C for ; Sat, 2 Jun 2012 10:19:24 +0000 (UTC) Received: (qmail 74634 invoked by uid 500); 2 Jun 2012 10:19:24 -0000 Delivered-To: apmail-db-derby-user-archive@db.apache.org Received: (qmail 74098 invoked by uid 500); 2 Jun 2012 10:19:19 -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 74057 invoked by uid 99); 2 Jun 2012 10:19:17 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 02 Jun 2012 10:19:17 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of john.foreign@gmail.com designates 209.85.214.44 as permitted sender) Received: from [209.85.214.44] (HELO mail-bk0-f44.google.com) (209.85.214.44) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 02 Jun 2012 10:19:09 +0000 Received: by bkty8 with SMTP id y8so2870441bkt.31 for ; Sat, 02 Jun 2012 03:18:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type; bh=zUGavMsQzx6bKYFuiY79ZvVZPkmkfwatAgPhhDpEEcc=; b=0jwuQMQqdiXyrsS38QOO5+5kgqnKHnUgfvAuVPa6EdjoOGwhsKtVEeGLwMvLmCD5d8 kD75jZe+e22Hnx+mG9IEJRz/pX1OC0sY46my38WMqfBA86WiPu4mDbjrMXnOhnlzgzX3 iJgAxq/hqPcfs3JCzqzP/X2rXdvvCAsE+KWo4Ln1+AEBTKsBzE1g2K37F40Sk7HHC5By Y+tu1FmiJ3CCznco6YsZBL3qJXA7QVY8VHrGE59uAtRyTLj1sWdJ+Qe9B2VuEtj9QocT yeyO9Kd7gD+IjxPuUQSS9WSFaY653fV/xNUFSkLxA0xkXvDR6PjEnzW5Dfex71bTGunC fliw== Received: by 10.204.156.209 with SMTP id y17mr3440841bkw.113.1338632328207; Sat, 02 Jun 2012 03:18:48 -0700 (PDT) Received: from [192.168.1.101] (bzq-84-110-220-59.red.bezeqint.net. [84.110.220.59]) by mx.google.com with ESMTPS id ig1sm4502237bkc.4.2012.06.02.03.18.46 (version=SSLv3 cipher=OTHER); Sat, 02 Jun 2012 03:18:47 -0700 (PDT) Message-ID: <4FC9E882.8040609@gmail.com> Date: Sat, 02 Jun 2012 13:18:42 +0300 From: John English User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:12.0) Gecko/20120428 Thunderbird/12.0.1 MIME-Version: 1.0 To: derby-user@db.apache.org Subject: Re: "Conglomerate could not be created"? References: <4FC8B339.8090502@gmail.com> In-Reply-To: <4FC8B339.8090502@gmail.com> Content-Type: multipart/alternative; boundary="------------010306010009020907010101" X-Virus-Checked: Checked by ClamAV on apache.org This is a multi-part message in MIME format. --------------010306010009020907010101 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit On 01/06/2012 15:19, John English wrote: > I'm having trouble with the following error: "Conglomerate could not be > created". It happens when I do this: > > INSERT INTO resource_usage (resid,itemid,itemtype) > (SELECT resid,?,? FROM resource_usage > WHERE itemid=? > AND itemtype=? > AND NOT EXISTS (SELECT resid FROM resource_usage > WHERE itemid=? AND itemtype=?)); > I also get the same error from this, which looks fairly innocuous to me: INSERT INTO resource_usage (resid,itemid,itemtype) (SELECT resid,20,'final' FROM resource_usage WHERE itemid=? AND itemtype=?); Is it perhaps because I'm inserting into the same table I'm selecting from? -- John English If we were to define a religion to be a system of thought which contains unprovable statements, so it contains an element of faith, then Gödel has taught us that not only is mathematics a religion but it is the only religion able to prove itself to be one. --- John Barrow, /Pi in the Sky / --------------010306010009020907010101 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit On 01/06/2012 15:19, John English wrote:
I'm having trouble with the following error: "Conglomerate could not be
created". It happens when I do this:

  INSERT INTO resource_usage (resid,itemid,itemtype)
    (SELECT resid,?,? FROM resource_usage
     WHERE itemid=?
     AND   itemtype=?
     AND   NOT EXISTS (SELECT resid FROM resource_usage
                       WHERE itemid=? AND itemtype=?));

I also get the same error from this, which looks fairly innocuous to me:
INSERT INTO resource_usage (resid,itemid,itemtype)
   (SELECT resid,20,'final' FROM resource_usage WHERE itemid=? AND itemtype=?);
Is it perhaps because I'm inserting into the same table I'm selecting from?
--
John English If we were to define a religion to be a system of thought which contains unprovable statements, so it contains an element of faith, then Gödel has taught us that not only is mathematics a religion but it is the only religion able to prove itself to be one.
John Barrow, Pi in the Sky
--------------010306010009020907010101--