What is use of a cursor variable in oracle? How it is defined?
A cursor variable works like pointer in C. It is used to hold address of an item rather than the item itself. Cursor variables can be used to hold different values at run time. They can be used to pass query result sets between PL/SQL stored subprograms.
Declaring a cursor variable:
TYPE type_name IS REF CURSOR RETURN return_type
type_name is the name of the reference type
return_type is a record type indicating the types of the select list that will eventually be returned by the cursor variable.