If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > problems while casting timestamp

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 10-31-03, 08:34
manish21 manish21 is offline
Registered User
 
Join Date: Jan 2003
Posts: 35
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?
Reply With Quote
  #2 (permalink)  
Old 10-31-03, 08:43
Marcus_A Marcus_A is offline
Registered User
 
Join Date: May 2003
Location: USA
Posts: 5,198
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?
Reply With Quote
  #3 (permalink)  
Old 11-03-03, 08:52
manish21 manish21 is offline
Registered User
 
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]
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On