- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
How will you keep the CURSOR open after firing COMMIT in a COBOL-DB2 program?
Whenever we issue a COMMIT statement, all the open cursors will get closed. This is a very common case when we have to frequently use the commit statement after a UPDATE while working with a cursor. In this case we can use the “WITH HOLD” clause during the cursor declaration.
The “WITH HOLD” clause will keep the cursor open even after firing the COMMIT statement. We can give the “WITH HOLD” clause in the following way.
EXEC SQL DECLARE ORDER_CUR CURSOR WITH HOLD FOR SELECT ORDER_ID, TRANSACTION_ID FROM ORDERS WHERE ORDER_DATE = ‘2020-07-28’ END-EXEC
- Related Articles
- How will you detect the condition of the end of cursor rows in a COBOL-DB2 program?
- How can you revert all the DB2 table changes done in a COBOL-DB2 program?
- What are the steps involved to use a CURSOR in any COBOL-DB2 program?
- How to close the ResultSet cursor automatically, after commit in JDBC?
- How to precompile a COBOL-DB2 program?
- How to Maintain an open ResultSet after commit in JDBC?
- How will you keep the locks on the resources even after a ROLLBACK?
- How will the COBOL-DB2 program behave if the DCLGEN member is not included?
- What will be the result if SQLCA is not included in a COBOL-DB2 program?
- Steps involved in compilation of a COBOL-DB2 program
- Implementation of restart logic in a COBOL-DB2 program
- How to execute a COBOL-DB2 program PROGA of plan PLANA?
- How to store a NULL value in a particular column of a DB2 table using COBOL-DB2 program?
- Impact of database downtime on the COBOL-DB2 program
- What is the purpose of the "FOR UPDATE OF" clause in a cursor? What will happen if we fire an UPDATE statement without using this clause in a COBOL-DB2 program?

Advertisements