Strange length restriction with the DB2 LIKE operator
问题 I found a funny issue with DB2 v9.7 and the SQL LIKE operator. Check this out: -- this works and returns one record select 1 from SYSIBM.DUAL where 'abc' like concat('a', 'bc') -- this doesn't work select 1 from SYSIBM.DUAL where 'abc' like concat(cast('a' as varchar(2001)), cast('bc' as varchar(2000))) -- It causes this error (from JDBC): -- No authorized routine named "LIKE" of type "FUNCTION" having compatible -- arguments was found.. SQLCODE=-440, SQLSTATE=42884, DRIVER=4.7.85 I've played