- 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
What is the usage of scrollable cursor for absolute positioning?
The SCROLLABLE CURSOR can be used to directly point the cursor position to the mentioned absolute position. The absolute position is the position of a particular row in the result table from the first row.
We can fetch the absolute position by using ABSOLUTE parameter in the FETCH statement. For example, we have to declare a scrollable cursor as below.
EXEC SQL DECLARE ORDER_CURR SCROLL CURSOR FOR SELECT ORDER_ID, ORDER_DATE FROM ORDERS WHERE ORDER_DATE = ‘2020-07-29’ END-SQL
Now if we want to fetch the absolute 9th row then we will use FETCH statement like below.
EXEC SQL FETCH ABSOLUTE +9 ORDER_CURR INTO :ORDER-ID, :ORDER-DATE END-SQL
Advertisements