A cursor variable holds a pointer to a query result set. Unlike a static cursor, a cursor variable is not tied to a single query — you can open the same cursor variable multiple times, each time with a different query.
How it works
A cursor variable contains a pointer to a result set, not the data itself. When you execute an OPEN FOR statement, a new result set is created from that query and made accessible through the cursor variable. Because the cursor variable is a pointer, you can reassign it to a different result set by opening it again with another query.
This contrasts with a static cursor, which is bound to one query and cannot be reused with a different query.
Use REF CURSOR with subprograms
REF CURSOR types can be passed as parameters to or from stored procedures and functions. A function's return type can also be a REF CURSOR type.
This lets you distribute cursor operations across separate program units, passing a cursor variable between programs to modularize cursor-related logic.