您的位置:首页 > 数据库

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

2016-06-26 20:26 507 查看
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;
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: