Check for empty REF CURSOR in PL/SQL
446249Oct 16 2006 — edited Oct 16 2006Hi. From a web page, I'm calling a PL/SQL stored procedure that opens a SYS_REFCURSOR. Is there a way to test the cursor to see if it has any rows? Your help is much appreciated,
procedure p_get_classes(prm_id in number, prm_crs out sys_refcursor) is
begin
open prm_crs for
select s.full_name, s.course_name
from classes s
where s.id = prm_id
order by s.course_name;
/* can a test be performed on the cursor here to see if it's empty? */
end p_get_classes;