- Trending Categories
- Data Structure
- Operating System
- C Programming
- 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 can you revert all the DB2 table changes done in a COBOL-DB2 program?
We can revert all the changes done on a COBOL-DB2 program using the ROLLBACK statement. However, ROLLBACK is only applicable until COMMIT has not been issued. If we have used a COMMIT statement, then ROLLBACK will revert all the changes made in DB2 tables after the last COMMIT point.
For example, after the commit statement, we execute an UPDATE statement to modify the ORDER_PAID column of ORDERS table. After that if we fire ROLLBACK then the UPDATE on the ORDERS table will be reverted.
EXEC SQL COMMIT END-EXEC EXEC SQL UPDATE ORDERS SET ORDERS_PAID = ‘YES’ WHERE ORDER_DATE = :WS-CURRENT-DATE END-EXEC EXEC SQL ROLLBACK END-EXEC
In this case, after firing the ROLLBACK statement, all the changes made by UPDATE statement will be reverted.
- How to get the list of all COBOL-DB2 programs using a DB2 table TAB1?
- How to precompile a COBOL-DB2 program?
- How to store a NULL value in a particular column of a DB2 table using COBOL-DB2 program?
- How will you keep the CURSOR open after firing COMMIT in a COBOL-DB2 program?
- Implementation of a table level locks in a COBOL-DB2 program during program execution
- How can a COBOL-DB2 program call a STORED PROCEDURE? Give an example.
- Implementation of restart logic in a COBOL-DB2 program
- Steps involved in compilation of a COBOL-DB2 program
- How will you detect the condition of the end of cursor rows in a COBOL-DB2 program?
- Impact of database downtime on the COBOL-DB2 program
- What is a use of DSNTIAR? How will you implement it in a COBOL-DB2 program?
- Implementation of a table level locks in a COBOL-DB2 program during SQL execution
- Write a DB2 query to find out all the duplicate INVOICE_ID in ORDERS DB2 table?
- How to execute a COBOL-DB2 program PROGA of plan PLANA?
- Purpose and usage of SAVEPOINT in COBOL-DB2 program