to: waterfirer(水清) 我聽的不是太明白,例外應該怎樣定義, raise是否一定要在Except後才可用,最好能給個例子,謝謝!
写了一个例子发了好多次,都有“请不要发表可能给我们带来伤害的言论,谢谢配合”,都不知道是哪个词被禁用了,郁闷,只好删掉大部分 begin select count(*) into vcount from a; if vount=0 then raise exceptionDataNotFind; end if; EXCEPTION when exceptionDataNotFind then 你的处理1 when others then 你的处理2 end;
exceptionDataNotFind EXCEPTION; --没有计算数据
在需要的地方raise exceptionDataNotFind在when exceptionDataNotFind then 中写你要提示的信息
我聽的不是太明白,例外應該怎樣定義,
raise是否一定要在Except後才可用,最好能給個例子,謝謝!
begin
select count(*) into vcount from a;
if vount=0 then
raise exceptionDataNotFind;
end if;
EXCEPTION
when exceptionDataNotFind then
你的处理1
when others then
你的处理2
end;