首页 > 数据库技术 > 详细

oracle plsql 异常

时间:2019-06-07 13:48:31      阅读:82      评论:0      收藏:0      [点我收藏+]
set serveroutput on

DECLARE
pename emp.ename%type;
begin
select ename into pename from emp where ename=1213;
exception
when
no_data_found then     dbms_output.put_line(没有该数据);
when
others then  dbms_output.put_line(其他exception);
end;
set serveroutput on

DECLARE
pename emp.ename%type;
begin
select ename into pename from emp where ename=1213;
exception
when
no_data_found then     dbms_output.put_line(没有该数据);
when
others then  dbms_output.put_line(其他exception);
end;

 

set serveroutput on

DECLARE
pnum number;
begin
pnum:=1/0;
exception
when
zero_divide then     dbms_output.put_line(0不能做除数);
when
others then  dbms_output.put_line(其他exception);
end;
set serveroutput on

DECLARE
pnum number;
begin
pnum:=abc;
exception
when
value_error then     dbms_output.put_line(value_erroe);
when
others then  dbms_output.put_line(其他exception);
end;

 

oracle plsql 异常

原文:https://www.cnblogs.com/wangchuanfu/p/10987928.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!