Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Inconsistent error with a query to update timestamp

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> ABENDS & Debugging
View previous topic :: :: View next topic  
Author Message
vinay19

New User


Joined: 31 May 2007
Posts: 24
Location: Bangalore

PostPosted: Tue Jun 10, 2008 6:36 pm    Post subject: Inconsistent error with a query to update timestamp
Reply with quote

hi all,

We are facing a peculiar problem in one of our program. There is query in one of our programs to update a column which is of type timestamp.

There is a query to update this timestamp which is as follows

UPDATE TABLE
SET LOCK_TIMESTAMP = CURR_LOCK_TIMESTAMP
WHERE LOCK_TIMESTAMP < CURR_LOCK_TIMESTAMP
AND .....

There is a particular logic to calculate CURR_LOCK_TIMESTAMP
This query gets executed sometimes successfully and sometimes not. With the same code base.

I want to know what is the possible reason for this. If it fails it should fail every time else it should get executed correctly each time.

If anyone has faced such an issue previously let me know.

thanks in advance.
Back to top
View user's profile Send private message

enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10256
Location: italy

PostPosted: Tue Jun 10, 2008 6:51 pm    Post subject: Reply to: Inconsistent error
Reply with quote

Quote:
There is a particular logic to calculate CURR_LOCK_TIMESTAMP

review the logic...

Quote:
If it fails it should fail every time else it should get executed correctly each time.

no if the computation is wrong only for certain values icon_cool.gif
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6967
Location: porcelain throne

PostPosted: Tue Jun 10, 2008 6:59 pm    Post subject:
Reply with quote

what is the error that your are facing?????????????????

if it is a -180 or -181 then enrico is correct, your particular logic sucks for calculation of curr_lock_timestamp.
Back to top
View user's profile Send private message
vinay19

New User


Joined: 31 May 2007
Posts: 24
Location: Bangalore

PostPosted: Wed Jun 11, 2008 5:27 pm    Post subject:
Reply with quote

hi all,

Thanks for your replies. The issue is now resolved. I was not getting sqlcode 180 or anything else. The query was failing with an sqlcode 100.

The logic to calculate timestamp is perfect.

There was a logic error in the code.

For people interested to know what was the problem.

The extension of lock was happening only once initially, but it is changed to extend the lock twice now. But the catch is that while extending the lock second time only first two digits of micro seconds in timestamp is taken into account and not the last four and the lag between the first and second extension would be such that it would be only in the last four digits of micro seconds.

So whenever the load was more on db2 the lag would ve reached upto first two digits of microseconds that time i was not gettting any error but in the other cases.
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10256
Location: italy

PostPosted: Wed Jun 11, 2008 6:47 pm    Post subject: Reply to: Inconsistent error
Reply with quote

Quote:
The logic to calculate timestamp is perfect.

if You say so icon_eek.gif
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> ABENDS & Debugging All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Fileaid Update Replace with null string descann Compuware & Other Tools 4 Mon May 15, 2017 3:00 pm
No new posts Getting error while opening a variabl... apandey1 COBOL Programming 5 Fri May 05, 2017 12:22 pm
This topic is locked: you cannot edit posts or make replies. Merge two files and update Trailer re... Yashashri JCL & VSAM 1 Thu May 04, 2017 12:54 pm
No new posts IDC2902I Error tzeche ABENDS & Debugging 2 Tue Mar 28, 2017 11:39 am
No new posts Need help with below DB2 error ashek15 DB2 3 Sat Mar 18, 2017 5:56 am


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us