oracle plsql 自定义异常

前端之家收集整理的这篇文章主要介绍了oracle plsql 自定义异常前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
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;

猜你在找的Oracle相关文章