DECLARE
  x INTEGER;
BEGIN
  BEGIN
    SELECT empno
    INTO x
    FROM emp;
  EXCEPTION
    WHEN OTHERS THEN
      raise_application_error(-20100,'Blad spowodowany bledem!');
  END;
EXCEPTION
  WHEN OTHERS THEN
    IF SQLCODE = -20100 THEN
      DBMS_OUTPUT.Put_Line(SQLERRM);
    END IF;
END;
/
