Return-Path: Delivered-To: apmail-db-derby-dev-archive@www.apache.org Received: (qmail 51561 invoked from network); 10 May 2005 17:09:33 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 10 May 2005 17:09:33 -0000 Received: (qmail 28176 invoked by uid 500); 10 May 2005 17:12:43 -0000 Delivered-To: apmail-db-derby-dev-archive@db.apache.org Received: (qmail 28138 invoked by uid 500); 10 May 2005 17:12:43 -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: "Derby Development" Delivered-To: mailing list derby-dev@db.apache.org Received: (qmail 28114 invoked by uid 99); 10 May 2005 17:12:42 -0000 X-ASF-Spam-Status: No, hits=0.2 required=10.0 tests=UPPERCASE_25_50 X-Spam-Check-By: apache.org Received-SPF: pass (hermes.apache.org: local policy) Received: from nwkea-mail-2.sun.com (HELO nwkea-mail-2.sun.com) (192.18.42.14) by apache.org (qpsmtpd/0.28) with ESMTP; Tue, 10 May 2005 10:12:41 -0700 Received: from phys-biff-1 ([129.158.227.36]) by nwkea-mail-2.sun.com (8.12.10/8.12.9) with ESMTP id j4AH97Q1004910 for ; Tue, 10 May 2005 10:09:08 -0700 (PDT) Received: from conversion-daemon.biff-mail1.india.sun.com by biff-mail1.india.sun.com (iPlanet Messaging Server 5.2 HotFix 1.24 (built Dec 19 2003)) id <0IGA003019YHWK@biff-mail1.india.sun.com> (original mail from Shreyas.Kaushik@Sun.COM) for derby-dev@db.apache.org; Tue, 10 May 2005 22:38:43 +0530 (IST) Received: from [192.168.1.100] (vpn-129-150-156-27.India.Sun.COM [129.150.156.27]) by biff-mail1.india.sun.com (iPlanet Messaging Server 5.2 HotFix 1.24 (built Dec 19 2003)) with ESMTP id <0IGA00BQQAAIXH@biff-mail1.india.sun.com> for derby-dev@db.apache.org; Tue, 10 May 2005 22:38:43 +0530 (IST) Date: Tue, 10 May 2005 22:39:16 +0530 From: Shreyas Kaushik Subject: Re: [jira] Commented: (DERBY-37) detection of incorrect types comparison is done at ? parameters In-reply-to: <4196838.1115738308183.JavaMail.jira@ajax.apache.org> To: Derby Development Message-id: <4280EABC.40104@sun.com> MIME-version: 1.0 Content-type: text/plain; charset=ISO-8859-1; format=flowed Content-transfer-encoding: 7BIT X-Accept-Language: en-us, en User-Agent: Mozilla Thunderbird 1.0 (X11/20041206) References: <4196838.1115738308183.JavaMail.jira@ajax.apache.org> X-Virus-Checked: Checked X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N There are two "?" in your query I see , check whether both of them are being set with types that are comparable with them. May be you should run over your table structures as well just to ensure that the columns have the appropriate data types. You can also look at http://incubator.apache.org/derby/manuals/reference/sqlj125.html#HDRSII-SQLJ-58560 Hope this helps. ~ Shreyas Mamta A. Satoor (JIRA) wrote: > [ http://issues.apache.org/jira/browse/DERBY-37?page=comments#action_64845 ] > >Mamta A. Satoor commented on DERBY-37: >-------------------------------------- > >I tried following on Derby and didn't get any comparison errors. > s.executeUpdate("create table xxxx (COLUMN_A INT, COLUMN_B INT )"); > PreparedStatement ps = con.prepareStatement("select * from xxxx where COLUMN_B >= ?"); > ps.setInt(1,1); > ps.execute(); > > > > >>detection of incorrect types comparison is done at ? parameters >>--------------------------------------------------------------- >> >> Key: DERBY-37 >> URL: http://issues.apache.org/jira/browse/DERBY-37 >> Project: Derby >> Type: Bug >> Environment: Cloudscape 10 beta >> Reporter: Erik Bengtson >> >> > > > >>java code: >>PreparedStatement ps = conn.prepareStatement(statement); >>This statement: >>SELECT THIS.CODE_EID,THIS.COMPOSED_EID,'org.jpox.samples.applicationidentity.ChildComposedIntID' as JPOXMETADATA ,THIS.INTEGER_IDX AS JPOXORDER0,ELEMENT_1.CODE,ELEMENT_1.COMPOSED,ELEMENT_1.DESCRIPTION,ELEMENT_1."NAME" FROM NORMALLISTAPPLICATIONID_COMPOS THIS INNER JOIN CHILDCOMPOSEDINTID "ELEMENT" ON THIS.CODE_EID = "ELEMENT".CODE AND THIS.COMPOSED_EID = "ELEMENT".COMPOSED INNER JOIN COMPOSEDINTID ELEMENT_1 ON "ELEMENT".CODE = ELEMENT_1.CODE AND "ELEMENT".COMPOSED = ELEMENT_1.COMPOSED WHERE THIS.NORMALLISTAPPLICATIONID_ID_OID = ? AND THIS.INTEGER_IDX >= ? ORDER BY JPOXORDER0 >>results in: >>SQL Exception: Comparisons between 'VARCHAR' and 'INTEGER' are not supported. >>possible cause: >>The INTEGER_IDX is an INTEGER column. While running the prepareStatement, JDBC/Cloudscape thinks I'm comparing INTEGER_IDX with ? (question mark) (INTEGER vs VARCHAR). This is not true, ? (question mark) is a parameter that will be later substitued in my code by an integer value. >> >> > > >