DECLARE
  CURSOR pracownicy IS
    SELECT * FROM emp
    FOR UPDATE OF sal;
BEGIN
  FOR rekord IN pracownicy LOOP
    IF rekord.sal > 1000 THEN
      UPDATE emp SET sal = sal * 2
      WHERE CURRENT OF pracownicy;
    ELSIF rekord.comm is null THEN
      DELETE FROM emp
      WHERE CURRENT OF pracownicy;
    END iF;
  END LOOP;
END;
/
