User Tools

Site Tools


kurs:exception_raise_und_raise_application_error
declare
  e_emp_remaining exception;
  
  e_no_department exception;
  
  pragma exception_init
    (e_emp_remaining, -2292);
    
  pragma exception_init
    (e_no_department, -20001);
  
begin
  delete from departments where department_id = 2701;
  if SQL%notfound then 
    raise_application_error(-20001, 'kein department');
  --  raise e_no_department;
  end if;
  rollback;

exception 
  when e_no_department then
  dbms_output.put_line('kein department >'
    || SQLCODE ||'< '
    || SQLERRM );  
  when e_emp_remaining then
  dbms_output.put_line('noch employees da! >'
    || SQLCODE ||'< '
    || SQLERRM );

end;
kurs/exception_raise_und_raise_application_error.txt · Last modified: 2014/09/10 21:22 (external edit)