Bryan Pendleton created DERBY-6020:
--------------------------------------

             Summary: Issue a clearer syntax error message for use of LIKE with 
a numeric column
                 Key: DERBY-6020
                 URL: https://issues.apache.org/jira/browse/DERBY-6020
             Project: Derby
          Issue Type: Improvement
    Affects Versions: 10.9.1.0
            Reporter: Bryan Pendleton


I tried to use 'LIKE' with a numeric column, and the message was quite 
confusing:

ij version 10.9
ij> connect 'jdbc:derby:brydb;create=true';
WARNING 01J01: Database 'brydb' not created, connection made to existing 
database instead.
ij> drop table bry;
0 rows inserted/updated/deleted
ij> CREATE TABLE bry( col1 varchar(10), JOBNUMBER INTEGER default 0);
0 rows inserted/updated/deleted
ij> select * from bry where col1 like '%' or JobNumber like '%';
ERROR 42884: No authorized routine named 'LIKE' of type 'FUNCTION' having 
compatible arguments was found.
ij> quit;


It would have been much easier to diagnose my problem if the message had said 
something like:

ERROR xxxxx: Operator 'LIKE' must be used with a character expression, but 
argument 'JobNumber' is of type 'INTEGER'



--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to