set serveroutput on
declare
  v_idno    paydata1.idno%TYPE;
  v_name    varchar2(25);
  v_hourswk number(4);
  v_tot     number(4);
  cursor payinfo_cursor is
       select idno, name
          from paydata1
          order by idno;
  cursor paytran_cursor is
       select hourswk
          from paytran1
          where v_idno = idno
          order by idno;     
  begin
     open payinfo_cursor;
     fetch payinfo_cursor into v_idno, v_name;
     while payinfo_cursor%found loop
         open paytran_cursor;
         v_tot := 0;
         fetch paytran_cursor into v_hourswk;
         while paytran_cursor%found loop
            v_tot := v_tot + v_hourswk;
            dbms_output.put_line(v_name || ' ' || v_tot);
            fetch paytran_cursor into v_hourswk;
         end loop;
         close paytran_cursor;
         fetch payinfo_cursor into v_idno, v_name;  
     end loop;
     close payinfo_cursor;
  end;
/
set serveroutput off