You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-dev@db.apache.org by "Dag H. Wanvik (JIRA)" <ji...@apache.org> on 2013/01/07 06:18:13 UTC
[jira] [Commented] (DERBY-6020) Issue a clearer syntax error
message for use of LIKE with a numeric column
[ https://issues.apache.org/jira/browse/DERBY-6020?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13545641#comment-13545641 ]
Dag H. Wanvik commented on DERBY-6020:
--------------------------------------
We use this error (SQLState.LANG_DB2_FUNCTION_INCOMPATIBLE) to handle the following cases of wrong expression types also:
|| (concatenation)
LOCATE
SUBSTR
I agree the wording it makes the error harder to understand.
> 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