From derby-user-return-14381-apmail-db-derby-user-archive=db.apache.org@db.apache.org Sat Jun 2 09:21:52 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 7F6519B03 for ; Sat, 2 Jun 2012 09:21:52 +0000 (UTC) Received: (qmail 69194 invoked by uid 500); 2 Jun 2012 09:21:52 -0000 Delivered-To: apmail-db-derby-user-archive@db.apache.org Received: (qmail 68774 invoked by uid 500); 2 Jun 2012 09:21:47 -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 68739 invoked by uid 99); 2 Jun 2012 09:21:46 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 02 Jun 2012 09:21:45 +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 (nike.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 09:21:36 +0000 Received: by bkty8 with SMTP id y8so2845690bkt.31 for ; Sat, 02 Jun 2012 02:21:15 -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=fxCOMeeQFIaLBBmT+fi5HTeHp8796hxStZv4wO8CFLg=; b=MKR584r3csF3M3+v0mBxTVvPhjjK4vn3tMKcqM0gwqZPD9iNMP+tiHSXWoFkII/AsF RlL3FKMxi+CS3bhqY4OfRuiJA46q4SWPEj/Wgw+15oFKIK/cURoW1ENMziNywHKPOoKw gxHg6uJCb9bTB0XzkA3TAZ5SuxbEVN11pVEYN8h+g+RZbQkAgU/ktbfeUkVsfCaN6nI6 iRrVqteCd081vqLb2W9RbC4gueTvBbyOBSLRfkKqaMj1qgFbCOrmPiorvauGQqXsd4Vb KAPZFHRoJ0AziIhRhHvmGiLmQVW1HjYrLWpZ+T30ebfe3KhU1BFjejdXVUxl835A4pQG ZFNQ== Received: by 10.205.134.4 with SMTP id ia4mr3311778bkc.57.1338628875361; Sat, 02 Jun 2012 02:21:15 -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 e20sm4370185bkv.10.2012.06.02.02.21.13 (version=SSLv3 cipher=OTHER); Sat, 02 Jun 2012 02:21:14 -0700 (PDT) Message-ID: <4FC9DB06.6040007@gmail.com> Date: Sat, 02 Jun 2012 12:21:10 +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: Content-Type: multipart/alternative; boundary="------------090109090705060105050003" This is a multi-part message in MIME format. --------------090109090705060105050003 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit On 01/06/2012 16:36, Knut Anders Hatlen wrote: > John English writes: > >> 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 think Derby doesn't allow untyped parameters in the select list. For > example, this fails: > > ij> prepare ps as 'select ? from sysibm.sysdummy1'; > ERROR 42X34: There is a ? parameter in the select list. This is not allowed. > > Whereas this works: > > ij> prepare ps as 'select cast(? as int) from sysibm.sysdummy1'; > ij> execute ps using 'values 1'; > 1 > ----------- > 1 > Thanks for the suggestion, but unfortunately that isn't the solution. I tried what you said and got the same error. I also turned on statement logging and both versions (with and without cast) compile, but they fail when executed: Begin compiling prepared statement: INSERT INTO resource_usage (resid,itemid,itemtype) (SELECT resid,?,? FROM ... End compiling prepared statement: INSERT INTO resource_usage (resid,itemid,itemtype) (SELECT resid,?,? FROM ... Executing prepared statement: INSERT INTO resource_usage (resid,itemid,itemtype) (SELECT resid,?,? FROM ... I also tried using a MessageFormat to sub the values into the query to eliminate the first two parameters, and again got the same thing. So I'm still thrashing around in search of a solution... -- 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 / --------------090109090705060105050003 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit On 01/06/2012 16:36, Knut Anders Hatlen wrote:
John English <checkpoint.je@gmail.com> writes:

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 think Derby doesn't allow untyped parameters in the select list. For
example, this fails:

ij> prepare ps as 'select ? from sysibm.sysdummy1';
ERROR 42X34: There is a ? parameter in the select list.  This is not allowed.

Whereas this works:

ij> prepare ps as 'select cast(? as int) from sysibm.sysdummy1';
ij> execute ps using 'values 1';
1          
-----------
1          

Thanks for the suggestion, but unfortunately that isn't the solution. I tried what you said and got the same error. I also turned on statement logging and both versions (with and without cast) compile, but they fail when executed:

Begin compiling prepared statement: INSERT INTO resource_usage (resid,itemid,itemtype) (SELECT resid,?,? FROM ...
End compiling prepared statement: INSERT INTO resource_usage (resid,itemid,itemtype) (SELECT resid,?,? FROM ...
Executing prepared statement: INSERT INTO resource_usage (resid,itemid,itemtype) (SELECT resid,?,? FROM ...

I also tried using a MessageFormat to sub the values into the query to eliminate the first two parameters, and again got the same thing.

So I'm still thrashing around in search of a solution...
--
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
--------------090109090705060105050003--