MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

How to avoid cursor to reflect changes made in target table.

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Database
View previous topic :: View next topic  
Author Message
prog_mario
Beginner


Joined: 08 Sep 2007
Posts: 86
Topics: 27

PostPosted: Wed Oct 20, 2010 2:18 pm    Post subject: How to avoid cursor to reflect changes made in target table. Reply with quote

My cursor (COBOL PROG):
Code:

EXEC SQL
   DECLARE C1 CURSOR WITH HOLD FOR
     SELECT ROW_A
           ,ROW_B
           ,ROW_C
       FROM TABLE_A
END-EXEC

During the process I might insert rows into TABLE_A but those rows can not appear in my cursor when I fetch it.
I need it WITH HOLD because I have to commit the inserts and maintain the cursor opened.
I don't want to use timestamp as a flag in the WHERE clause.

Any help.
Thanks a lot.
:(
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12378
Topics: 75
Location: San Jose

PostPosted: Wed Oct 20, 2010 3:32 pm    Post subject: Reply with quote

prog_mario,

Change the cursor definition to INSENSITIVE SCROLL CURSOR which will have the following effect

The size, the order of the rows, and the values for each row of the result table do not change after the application opens the cursor.

Read about it here

http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/dsnapj12/2.2.3.1.2

Kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
prog_mario
Beginner


Joined: 08 Sep 2007
Posts: 86
Topics: 27

PostPosted: Wed Oct 20, 2010 4:58 pm    Post subject: Reply with quote

Thanks a lot Kolusu. Always helping us. Many many thanks.
_________________
The more I learn, the more I want to learn.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Database All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group