set serveroutput on

DECLARE

cursor cemp is select ename from emp where deptno=50;
pename emp.ename%type;


--自定义异常
no_emp_found exception;
begin

open cemp;


fetch cemp into pename;




if 
cemp%notfound then 
raise no_emp_found;
end if;
close cemp;
exception 

when 
no_emp_found then dbms_output.put_line('自定义异常');
end;

 

相关文章:

  • 2021-09-26
  • 2021-06-13
  • 2022-01-09
猜你喜欢
  • 2021-09-10
  • 2021-10-21
  • 2021-07-03
  • 2021-08-21
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案