我要求自己提示錯誤哦,並不是系統產生的錯誤,raise好像是系統已經產生錯誤了吧

解决方案 »

  1.   

    可以自己定义例外/** 定义例外 **/ 
    exceptionDataNotFind              EXCEPTION;                          --没有计算数据
    在需要的地方raise exceptionDataNotFind在when exceptionDataNotFind then 中写你要提示的信息
      

  2.   

    to: waterfirer(水清)
    我聽的不是太明白,例外應該怎樣定義,
    raise是否一定要在Except後才可用,最好能給個例子,謝謝!
      

  3.   

    写了一个例子发了好多次,都有“请不要发表可能给我们带来伤害的言论,谢谢配合”,都不知道是哪个词被禁用了,郁闷,只好删掉大部分
    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;