13PL_SQL过程之错误处理即捕获异常

来源:互联网 发布:女生色诱男生 知乎 编辑:程序博客网 时间:2024/06/07 00:43
declare
  v_temp number(4);
begin
  select empno into v_temp from emp where deptno=10;
  exception
    when too_many_rows then
      dbms_output.put_line('太多记录了');
    when others then
      dbms_output.put_line('error!');
end;






declare
  v_temp number(4);
begin
  select empno into v_temp from emp where empno=2222;
  exception
    when no_data_found then
      dbms_output.put_line('没有数据');
end;
0 0
原创粉丝点击