IBM Mainframe Forum Index
 
Register
 
IBM Mainframe Forum Index Mainframe: Search Log in to check your private messages Log in
 

For fetch only vs With ur


 
IBM Mainframe Forums -> DB2
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
kranthikumarb

Active User


Joined: 02 Jan 2009
Posts: 115
Location: Hyderabad

PostPosted: Wed May 29, 2013 3:54 pm
Reply with quote

Hi,

I searched the forum for this topic, although I found few, but didn't give me answer to my doubt. Can someone please help me with the below.

I have 2 jobs, one updates; other extract data from the table space.

The extract job has cursor that doesn't have any one of the below clauses

WITH UR
FOR FETCH ONLY.

Because both jobs run at the same time, I am getting a -911 on the extract job. So I was thinking of using UR in the select cursor. But the clients didn't want to see un committed data. So I was thinking of using FOR FETCH ONLY. Before using that I wanted to check the isolation level it is using. I submitted a command -DISPLAY DB(ZDXY0005) SPACENAM(TSXYX12) CLAIMERS when a long running select query is executing with "WITH UR" , "FOR FETCH ONLY" and with out any of these two. In all three instances the tabls space is in RW mode and the isolation level is (CS,C).

Surprising to see a CS,C when using WITH UR.

I can set the pred and successor conditions, but there are many reading jobs.

Prefer to do it via program.

Can someone help me am I doing something wrong in the display statement?

"FOR FETCH ONLY" - Is this same as WITH UR but will give committed data without locking any pages?
Back to top
View user's profile Send private message
kranthikumarb

Active User


Joined: 02 Jan 2009
Posts: 115
Location: Hyderabad

PostPosted: Wed May 29, 2013 4:12 pm
Reply with quote

Oopsy.... I found the extract program already has "FOR FETCH ONLY" in the declare.

Now more problems icon_sad.gif
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19251
Location: Inside the Matrix

PostPosted: Wed May 29, 2013 6:45 pm
Reply with quote

Hello,

It is NOT a good idea to extract data from a table while it is being updated. There is a strong possibility that the extract will contain incomplete or corrupt entries. . .
Back to top
View user's profile Send private message
gylbharat

Active Member


Joined: 31 Jul 2009
Posts: 565
Location: Bangalore

PostPosted: Thu May 30, 2013 5:29 pm
Reply with quote

Refer this - Use [URL] BBCode for Links
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic All times are GMT + 6 Hours
Forum Index -> DB2
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Forum Replies
No new posts Fetch the Dataset names from inside m... TSO/ISPF 18
No new posts How to fetch the latest record from a... DFSORT/ICETOOL 8
No new posts To fetch value separated by commas fr... DB2 3
No new posts Need to fetch data from database base... COBOL Programming 8
No new posts Fetch first first row in inner join! DB2 13

Back to Top