Portal | IBM Manuals | Downloads | Products | Refer | Info | Programs | JCLs | Forum Rules*| Site Map | Mainframe CD 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index
 
Register
 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index FAQ Search Memberlist Usergroups Profile Log in to check your private messages Log in
 
How to know the no of Rows affected with CURSOR

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
Author Message
vamseepotti

New User


Joined: 21 Oct 2003
Posts: 46

PostPosted: Thu Mar 04, 2004 9:50 am    Post subject: How to know the no of Rows affected with CURSOR
Reply with quote

Imagine your CURSOR updated 200 rows and COMMIT takes place. Then abend occurred at 201?215. How u know the number of rows updated by ur cursor and where abend occurred. Now, how u modify ur program which donot update the first 200 rows?
Back to top
View user's profile Send private message
References
PostPosted: Thu Mar 04, 2004 9:50 am    Post subject: Re: How to know the no of Rows affected with CURSOR Reply with quote

mdtendulkar

Active User


Joined: 29 Jul 2003
Posts: 257
Location: USA

PostPosted: Fri Mar 12, 2004 7:52 pm    Post subject:
Reply with quote

Hello vamseepotti,

Code the cursor as below:

Code:

DECLARE MYCURSOR CURSOR FOR
SELECT COLUMN1, COLUMN2
FROM MYTABLE
WHERE MYKEY > :WS-MY-KEY



Initially move LOW-VALUES to WS-MY-KEY.

After every commit, save the key in check point area.

During restart, move the saved key value to WS-MY-KEY and after the open and fetch of the cursor you will have the next record.

Hope this helps,

Regards
Mayuresh Tendulkar
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2 All times are GMT + 6 Hours
Page 1 of 1