I have a database table CUSTOMERS with a column CUSTOMER_CODE VARCHAR(20). This column used to be filled with integral codes. Executing
SELECT COUNT(*) FROM CUSTOMERS WHERE CUSTOMER_CODE = 12345
always used to work fine on the table. Now for some reason a CUSTOMER_CODE value 'C' has been inserted in the table. Since then, the same SELECT statements generates Error converting 'C' or something similar.
This occurs with both versions 1.4.200 and 2.1.214
It may be that this is conform SQL standards but it seems counter-intuitive to me. Why is the INTEGER literal 12345 not converted to VARCHAR but is the VARCHAR value in the column converted to INTEGER to evaluate the condition?