The Oracle ref cursor is a "pointer" data types that allows
you to quickly reference any cursor result (usually an internal PL/SQL table
array) with data values kept in super-fast RAM.
For details, see the book "PL/SQL
Tuning" with many Oracle ref cursor examples and ref cursor tips.
The name "ref cursor" can be confusing because a ref cursor variable is not a
cursor, but a variable that points to a cursor, similar to a Char** datatype in
the C language. In essence, an Oracle ref cursor allows you to store the
result of a "bulk collect" from a table (or any PL/SQL cursor return set) into a
PL/SQL table (RAM array) and then reference the array with the Oracle ref cursor as a
pointer. Here is a simple example of
using an Oracle ref cursor in PL/SQL.
Once you load a PL/SQL table, an Oracle ref cursor allows you to reference the array
within your PL/SQL code without having to pass the array to a new procedure or
function. Instead of passing the "baggage" of the actual RAM array, you simply
pass the Oracle ref cursor, which points to the PL/SQL table values.
PL/SQL ref cursor references: