SET SERVEROUTPUT ON
ACCEPT osztnev PROMPT 'Mi az osztaly neve?'
DECLARE
  i INTEGER := 0;
BEGIN
    FOR vmi IN (SELECT * FROM EMP WHERE deptno = (SELECT deptno FROM dept WHERE dname = '&osztnev'))
    LOOP
       i := i + 1;
       DBMS_OUTPUT.PUT_LINE(i || '. dolgozo a(z) "&osztnev" osztalyon: ' || vmi.ename);
    END LOOP;
END;