Since there's no information in the bare parameter marker as to the exact data type or precision of the parameter, the DB2 server uses the right side of the expression to determine it. You could use an explicit cast to provide the necessary information to the query compiler:
SELECT * FROM EMP WHERE cast(? as varchar(10)) = ' ' OR NAME = ?"
Replace varchar(10)
with the actual data type of EMP.NAME
.