declare
   v_job VARCHAR2(10);
   v_coder	NUMBER;
   v_meser	VARCHAR2(255);
begin
   select job
   into v_job
   from emp
   where ename='KING';
   if (v_job = 'PRESIDENT') then
     raise_application_error(-20100, 'Presedintele companiei');
   end if;
exception
   when others then
      v_coder := SQLCODE;
      v_meser := SQLERRM;
      dbms_output.put_line('Exceptia cu cod '||v_coder);
      dbms_output.put_line(' Mesaj eroare:'||v_meser);
end;
/
