Unanswered: How to Fetch Set of records from Open Cursor
I want to fetch specific set of records from the open cursor.
- My select statement returns 100 records
- I want to fetch only 50 to 60 records dynamically from the open cursor, something like fetch_range(50,60).
Is it possible to fetch range of records from the cursor. If Yes, What is the syntax.
In my select statement I have a column called priority_num the value ranges from 1 to 50. I have to display the data based on Priority_num in asc order. When I use rownum to restrict the return rows
WHERE rownum>=50 and rownum<=60 ORDER BY priority_num
query returning exactly 10 rows but not in priority_num order.
So instead of using ROWNUM, I want to prepare my select statement ORDER BY priority_num, empno.