I stink at PL/SQL and need your help badly.

Does this look right? I just want to check for the rows and display them. I need to put them later in a function. Any help would appreciated?

declare chldcur cat%row_type

begin

curc1 is
SELECT C.id, c.name
FROM cat c
WHERE child_count != (select count(child_Cat_id)
FROM cat_rel r
WHERE r.parent_Cat_id=c.id
GROUP BY parent_Cat_id);

if curc1%ISOPEN
then
close curc1;
end if;

open curc1;
fetch curc1 into chldcur;

while curc1%FOUND loop
dbms_output.put_line('id= 'chdcur.id);
dbms_output.put_line('name= 'chdcur.name);
fetch curc1 into chldcur;
end loop

close cur1
end;

or can I just say return curc1 instead of the dbms output lines?

Also I used cat%rowtype since I saw it in some example.. Is this correct, whct should I define it as?

Thanks so much,
Nirasha