- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
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
What is the purpose and usage of SCROLLABLE CURSOR in COBOLDB2 program?
A cursor can move only in forward direction, which means that it can extract the next row after every fetch. It is not possible to extract the previous row using a cursor.For example, if our resultant cursor contains following rows−
ORDER_ID | ORDER_DATE |
---|---|
A22367 | 2020-07-28 |
A66756 | 2020-07-28 |
A77890 | 2020-07-29 |
A96832 | 2020-07-29 |
If our cursor is currently pointing to 3rd row i.e. order id A77890 then the next fetch will point the cursor to the next row i.e. order id A96832. It is not possible to point the cursor to the previous order id i.e. A66756.
In order to achieve this, we use the concept of SCROLLABLE CURSOR. The SCROLLABLE CURSOR can move both in forward and backward direction, it can also move in the relative or absolute position from the current position. The SCROLLABLE CURSOR is very useful in implementing page up and page down logic in CICS screen.
- Related Articles
- What is the usage of scrollable cursor for absolute positioning?
- What is the usage of scrollable cursor for current positioning?
- What is the difference between SENSITIVE and INSENSITIVE scrollable CURSOR with syntax
- What is the usage and purpose of DCLGEN and host variables used in COBOL-DB2 program
- What is the purpose and usage of “WHERE CURRENT OF” clause in a COBOL-DB2 program?
- What is the purpose and usage of “FOR UPDATE OF” clause in a COBOL-DB2 program
- What is the purpose and usage of SQLCODE within the SQLCA in a COBOL-DB2 program
- Purpose and usage of SAVEPOINT in COBOL-DB2 program
- What is the purpose and usage of ATOMIC and NON-ATOMIC clause in multi row insert?
- How can you move the cursor in scrollable result sets in JDBC?
- Purpose and usage of ROW-ID and SEQUENCE in a DB2
- What is a use of DSNTIAR? How will you implement it in a COBOLDB2 program?
- Purpose and usage of subqueries in DB with the help of an example
- Write the syntax to declare a scrollable cursor on the ORDERS DB2 table.
- What is the purpose of a register in a CPU and what are special purpose registers?
