- 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
Write the syntax to declare a scrollable cursor on the ORDERS DB2 table.
A SCROLLABLE CURSOR can move in both forward and backward direction. In other words, it can fetch next as well as previous rows. A SCROLLABLE CURSOR is declared using the “SCROLL” clause in the DECLARE CURSOR.
For example, if we want to declare a SCROLLABLE CURSOR on the ORDERS table then we have to declare the cursor like below.
EXEC SQL DECLARE ORDER_CURR SCROLL CURSOR FOR SELECT ORDER_ID, ORDER_DATE FROM ORDERS WHERE ORDER_DATE = ‘2020-07-29’ END-SQL
- Related Articles
- How will you create a new TRIGGER on the ORDERS DB2 table? Give the syntax of TRIGGER
- Write the DB2 SQL query to find the third highest ORDER_TOTAL in a ORDERS DB2 table
- Write a DB2 query to find out all the duplicate INVOICE_ID in ORDERS DB2 table?
- Write a SQL query to count the number of duplicate TRANSACTION_ID in an ORDERS DB2 table
- What is the difference between SENSITIVE and INSENSITIVE scrollable CURSOR with syntax
- What is the usage of scrollable cursor for absolute positioning?
- What is the usage of scrollable cursor for current positioning?
- How can you move the cursor in scrollable result sets in JDBC?
- What is the purpose and usage of SCROLLABLE CURSOR in COBOLDB2 program?
- Declare syntax error in MySQL Workbench?
- What are the limitations of using OUTER JOIN on a DB2 table?
- What is the use and syntax of SEQUENCE in DB2?
- What are the steps involved to use a CURSOR in any COBOL-DB2 program?
- How will you find the ORDER_ID of all the orders having ORDER_TOTAL greater than the average of ORDER_TOTAL in ORDER's DB2 table
- How to get the list of all COBOL-DB2 programs using a DB2 table TAB1?

Advertisements