set serveroutput on
declare
  v_name varchar2(25);
  v_hours number(4);
  cursor payinfo is
      select paydata1.name, paytran1.hourswk 
          from paydata1, paytran1
          where paydata1.idno = paytran1.idno;
  begin
     open payinfo;
     fetch payinfo into v_name, v_hours;
     while payinfo%found loop
         dbms_output.put_line(v_name || ' ' || v_hours);
         fetch payinfo into v_name, v_hours;
     end loop;
     close payinfo;
  end;
/
set serveroutput off

    
 

