Here's how you can see the cursor in SQL*Plus:
sql>var rc refcursor
sql>exec foo.proc(:rc)
PL/SQL procedure successfully completed.
sql>print rc
LAST_NAME
------------------------------
Wallis
Flores
Arenas
Cummings
And if you want a procedure to show the output using DBMS_OUTPUT:
create or replace procedure footest
is
v_rc foo.rc;
v_last_name varchar2(30);
begin
foo.proc(v_rc);
loop
fetch v_rc into v_last_name;
exit when v_rc%notfound;
dbms_output.put_line(v_last_name);
end loop;
close v_rc;
end;
/
And then in SQL*Plus:
sql>set serveroutput on
sql>exec footest
Wallis
Flores
Arenas
Cummings
PL/SQL procedure successfully completed.