In a database on db2 v7.2ee, I have many queries in which I need to case timestamp as date.
For eg.
select emp_name, emp_id
from tbname
where emp_id =? and emp_name =? and
date(valid_from) =? and
date(valid_to) =?
This query runs fine in QMF. But when I run it through my application having J2EE 1.3 , AppServer --- Websphere,
When I run it for the first time, It throws an error.
SQLSTATE 24501 The identified cursor is not open.
The next time I go back and refresh the page , the query works fine
everytime. Why does this error occur only for the first time ?
And when I remove the date(timestamp) casting from the query, the query never gives this error. But I need to keep it as otherwise the query compares the timestamp till the milliseconds.
What should be done?