The only problem that I now have is that if I select columns of type TIMESTAMP a wrong value is returned, if I use the sysibm.sysdummy1 table in the subselect. If I use another table in the subselect everything is ok. My solution for now is that I do the following (assuming field1 is of type TIMESTAMP):
select TIMESTAMP(field1)
from tbl1
where (key1,key2) in
(select 'a1','b1'
from SYSIBM.SYSDUMMY1
union
select 'a2','b2'
from SYSIBM.SYSDUMMY1
)
It works but why is the wrong timestamp returned without using TIMESTAMP? Does anyone know a better solution?