Details
-
Improvement
-
Status: Open
-
Major
-
Resolution: Unresolved
-
10.0.2.1
-
None
-
Windows XP Professional, Service Pack 2; Dell Latitude D600; 1.5GB RAM
-
Normal
Description
Trying to run the same SQL query through JDBC-Derby and IJ results in the same error:
ERROR 42818: Comparisons between 'LONG VARCHAR' and 'CHAR' are not supported.
The same Java code/query works with MySQL 4.1 (Connector/J) and MS Access 2002 (JDBC-ODBC)
Table Definition:
CREATE TABLE itemdata (valuetext LONG VARCHAR);
SQL Statement
ij>SELECT * FROM itemdata WHERE valuetext = 'asdf';
ERROR 42818: Comparisons between 'LONG VARCHAR' and 'CHAR' are not supported.
I have tried to use the 'cast' function to perform a LONG VARCHAR comparison:
ij> select * from itemdata where valuetext = cast('asdf' as long varchar);
ERROR 42818: Comparisons between 'LONG VARCHAR' and 'LONG VARCHAR' are not supported.
The only way I've been able to get ANY result is the following:
ij> select * from itemdata where cast(valuetext as char) = 'asdf';
VALUETEXT
--------------------------------------------------------------------------------------------------------------------------------
ERROR 22001: A truncation error was encountered trying to shrink CHAR 'asdf' to length 1.
If I try to cast to VARCHAR, I get a syntax error:
ij> select * from itemdata where cast(valuetext as varchar) = 'asdf';
ERROR 42X01: Syntax error: Encountered ")" at line 1, column 63.
I also have this problem if I change itemdata.valuetext to CLOB.
Attachments
Issue Links
- relates to
-
DERBY-5130 Allow for LONG VARCHAR to be compared to LONG VARCHAR
- Open