SYS_REFCURSOR vs. REF CURSOR
Oracle supports the declaration of a cursor variable using both the SYS_REFCURSOR built-in data type as well as creating a type of REF CURSOR and then declaring a variable of that type.
Only the declaration of SYS_REFCURSOR and user-defined REF CURSOR variable is different. The remaining usage like opening the cursor, selecting into the cursor and closing the cursor is the same across both the cursor types. In the following postings of this topic we primarily make use of the SYS_REFCURSOR cursors. All you need to change in the examples to make them work for user defined REF CURSOR's is the declaration section.
The following is an example of a SYS_REFCURSOR variable declaration.
DECLARE
emp_refcur SYS_REFCURSOR;
The following is an example of a cursor variable declaration.
DECLARE
TYPE emp_cur_type IS REF CURSOR RETURN emp%ROWTYPE;
my_rec emp_cur_type;