In some databases like ORACLE,
queries executed from iBatis (maybe because of the jdbc driver?) with WHERE clauses involving CHAR columns, will have zero results, for example :
created using this script :
CREATE TABLE EMP (
EMPNO NUMBER(4) NOT NULL,
and we tried to query :
SELECT * FROM EMP WHERE ENAME='JONES'
will results in 0 records, although there should be 1 result.
This is because unlike VARCHAR, CHAR(10) is always treated 10 characters per string, so a workaround for this issue is to query like this
SELECT * FROM EMP WHERE ENAME=rpad('JONES',10,' ')