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;
相關文章
相關標籤/搜索