The following comment has been added to this issue:

     Author: Erik Bengtson
    Created: Mon, 11 Oct 2004 4:07 AM
       Body:

"SQL Exception: Comparisons between 'VARCHAR' and 'INTEGER' are not supported."

The above text between quotes is the Derby exception. I suggest that you try 
this to reproduce:

create table xxxx ( COLUMN_A INT, COLUMN_B INT )

conn.prepareStatement("SELECT * FROM xxxx where COLUMN_B >= ?");

-------------------

The same code runs fine with MSSQL, MySQL, Postgresql, Oracle and others. If 
you need more information, ask me.

 

---------------------------------------------------------------------
View this comment:
  http://issues.apache.org/jira/browse/DERBY-37?page=comments#action_53906

---------------------------------------------------------------------
View the issue:
  http://issues.apache.org/jira/browse/DERBY-37

Here is an overview of the issue:
---------------------------------------------------------------------
        Key: DERBY-37
    Summary: detection of incorrect types comparison is done at ? parameters
       Type: Bug

     Status: Unassigned
   Priority: Major

    Project: Derby

   Assignee: 
   Reporter: Erik Bengtson

    Created: Sun, 10 Oct 2004 1:36 PM
    Updated: Mon, 11 Oct 2004 4:07 AM
Environment: Cloudscape 10 beta 

Description:
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.


---------------------------------------------------------------------
JIRA INFORMATION:
This message is automatically generated by JIRA.

If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa

If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira

Reply via email to