With a collated database USER cannot be used in query against user tables 
without cast
--------------------------------------------------------------------------------------

                 Key: DERBY-2956
                 URL: https://issues.apache.org/jira/browse/DERBY-2956
             Project: Derby
          Issue Type: Bug
          Components: SQL
    Affects Versions: 10.4.0.0
            Reporter: Kathey Marsden


ij> create table staff (empname varchar(30));
0 rows inserted/updated/deleted
ij> insert into staff values('APP');
1 row inserted/updated/deleted
ij> insert into staff values('KATHEY');
1 row inserted/updated/deleted
ij> select * from staff where empname like USER;
ERROR 42ZA2: Operand of LIKE predicate with type VARCHAR(30) and collation 
TERRITORY_BASED is not compatable with LIKE p
attern operand with type VARCHAR(128) and collation UCS_BASIC.
ij>

Workaround is to use a cast 

ij>  select * from staff where empname like CAST(USER as VARCHAR(30));
EMPNAME
------------------------------
APP

1 row selected


-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to