declare
  v_contor number(2) :=5;
  v_deptno number;
  v_dname varchar2(10);
  v_loc varchar2(10);
begin
loop
  begin
  select deptno, dname, loc
  into v_deptno, v_dname, v_loc
  from dept
  where deptno=v_contor;
  dbms_output.put_line('Dep.cu cod '|| v_contor||' se numeste '||v_dname||' si este in '||v_loc);
  exception
  when no_data_found then
    dbms_output.put_line('Nu exista departamentul cu cod '|| v_contor);
  end;
v_contor := v_contor + 5;
exit when v_contor > 70;
end loop;
exception
when others then
  dbms_output.put_line('Exceptie');
end;
/
