IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Need a way to avoid closing of cursor.


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

New User


Joined: 24 Jul 2007
Posts: 18
Location: india

PostPosted: Tue Oct 12, 2010 5:33 pm
Reply with quote

Hi,

Is there any way through which I can avoid closing of cursor even after issuing ROLLBACK.

I know WITH HOLD does not work here. Ny other options????

Thanks
Back to top
View user's profile Send private message
Anuj Dhawan

Superior Member


Joined: 22 Apr 2006
Posts: 6250
Location: Mumbai, India

PostPosted: Tue Oct 12, 2010 7:55 pm
Reply with quote

Code:
EXEC SQL
ROLLBACK HOLD
END-EXEC


Specifies a hold on resources. If specified, currently open cursors are not closed and all resources acquired during the unit of work, except locks on the rows of tables, are held. Locks on specific rows implicitly acquired during the unit of work, however, are released.

At the end of a ROLLBACK HOLD, the cursor position is the same as it was at the start of the unit of work, unless

ALWBLK(*ALLREAD) was specified when the program or routine that contains the cursor was created
ALWBLK(*READ) and ALWCPYDTA(*OPTIMIZE) were specified when the program or routine that contains the cursor was created
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


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

PostPosted: Tue Oct 12, 2010 8:45 pm
Reply with quote

if you are not working on iSeries (big pc) or db2 for LUW,
then the mainframe z/OS manuals are applicable:

db2 vsn7 ROLLBACK

db2 vsn9.1 - PDF lookfor ROLLBACK

both essentially say the cursors are closed in batch.
in CICS or IMS, if you issue savepoints, the cursors are left open, but the cursor position is not changed - which means - you have to reposition the cursor.
Back to top
View user's profile Send private message
chitra_chaturvedi

New User


Joined: 24 Jul 2007
Posts: 18
Location: india

PostPosted: Fri Oct 15, 2010 10:54 am
Reply with quote

Thanks for your suggestions Anuj and DBZ..
Back to top
View user's profile Send private message
Anuj Dhawan

Superior Member


Joined: 22 Apr 2006
Posts: 6250
Location: Mumbai, India

PostPosted: Fri Oct 15, 2010 8:43 pm
Reply with quote

Please notice what Dick has said in his post. That's the key part to look at before you thank us...icon_smile.gif
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DB2

 


Similar Topics
Topic Forum Replies
No new posts How to avoid duplicating a CICS Web S... CICS 0
No new posts Is SQLCODE -811 possible while fetchi... DB2 1
No new posts Restart logic by using cursor name in... DB2 1
No new posts Seeking Resolution for SQKCODE -991 o... DB2 2
No new posts Multiple rows within Cursor when Coun... DB2 14
Search our Forums:

Back to Top