ORACLE 用户自定义异常小例子 1.进入pl/sql测试窗口 2.执行语句 declare empname varchar2(255); customize_exp EXCEPTION; –自定义异常 begin FOR c IN (select d.* from scott.dept d) LOOP begin dbms_output.put_line('dept: ' || c.deptno || '=' || c.dname); –当部门ID为40时抛出异常 if (c.deptno = 40) then