plsql抽风报错的事,求眼力好的看看两段代码,上面报错,下面可以执行
问题描述:
plsql抽风报错的事,求眼力好的看看两段代码,上面报错,下面可以执行,我他么要兔血了,可以拷贝过去执行试试
declare
cresult int;
val int; --全局变量
errorException exception; --申明异常
begin
val := 1/0;
exception
when errorException then
cresult := -1;
when others then
cresult := 0;
end;
DECLARE
cresult int;
val int; --全局变量
errorException exception; --申明异常
begin
val := 1/0;
exception --异常捕捉,不要把有需要的代码放在异常捕捉后面,有异常才会执行异常代码下所有代码,没有异常不会执行
when errorException then
cresult := -1;
when others then
cresult := 0;
end;
答
你这什么玩意。。