Results 1 to 3 of 3
  1. #1
    Join Date
    Jan 2003
    Posts
    35

    Unanswered: problems while casting timestamp

    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?

  2. #2
    Join Date
    May 2003
    Location
    USA
    Posts
    5,737
    What is your fixpak level? Did you look for APAR's?

    Are you sure that there is not a data or date format problem in the variables?

    Is there a declare cursor and open cursor associated with this select or is it a single SQL statement?

  3. #3
    Join Date
    Jan 2003
    Posts
    35
    It is a single sql statement. There is no declare cursor and open cursor associated with this select

    QUOTE]Originally posted by Marcus_A
    What is your fixpak level? Did you look for APAR's?

    Are you sure that there is not a data or date format problem in the variables?

    Is there a declare cursor and open cursor associated with this select or is it a single SQL statement?
    [/QUOTE]

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •