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
 

 

Need a way to avoid closing of cursor.

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
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    Post subject: Need a way to avoid closing of cursor.
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

Senior Member


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

PostPosted: Tue Oct 12, 2010 7:55 pm    Post subject:
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    Post subject:
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    Post subject: Reply to: Need a way to avoid closing of cursor.
Reply with quote

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

Senior Member


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

PostPosted: Fri Oct 15, 2010 8:43 pm    Post subject:
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    IBMMAINFRAMES.com Support Forums -> DB2 All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Getting -504 Cursor Name GTT-ARTS-CUR... Robin Sulsona DB2 2 Fri Mar 17, 2017 1:43 am
No new posts Release of Adabas Cursor mohitsethi All Other Mainframe Topics 1 Mon Feb 06, 2017 8:36 pm
No new posts Display ZEDLMSG without Pressing F1 &... anandgbe CLIST & REXX 8 Thu Dec 15, 2016 4:20 pm
No new posts Updating Cursor row withour using FOR... chandan.inst DB2 15 Tue Nov 08, 2016 11:17 am
No new posts Variable for cursor names ravikumar15 DB2 5 Sun Jul 17, 2016 7:08 am


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