create or replace procedure getcur(p_rc out SYS_REFCURSOR)
is
begin
open p_rc for 'select * from med_users';
end getcur;
declare
med_userss SYS_REFCURSOR;
v_row acs.med_users%ROWTYPE;
begin
getcur(med_userss);
loop
FETCH med_userss into v_row;
EXIT WHEN med_userss%NOTFOUND;
dbms_output.put_line(v_row.login_name);
end loop;
end;