exception
  when others then
      --do something;

解决方案 »

  1.   

    又是你啊,是那个过程有问题的strsql:='create or replace trigger '||tr_name||
               'before update
                on '||t||
               'begin
                   p_tt(sys.login_user,‘||t||’,''tt'');
                end;';
      

  2.   

    我用了others
       exception when user_excp then
                 raise_application_error(-20000,‘****用户错误****’);
                 when others then
                 null;
    可是:ORA-20000: ****用户定义错误*****
          ORA-06512: 在"YUANLINA.CHECK_BY_RULES", line 69
          ORA-06512: 在line 1  
    的最后两行不是其他异常引起的错误而是告之错误位置的。但怎么才能不在
    可户的应用程序中显示这些位置信息呢,我只需要应用程序知道为什么错了
    就可以了。唉!!!艰难啊!要向各位高手好好学习了。有的问题从书上也不知道怎么找
    。最近累呀!
      

  3.   

    对不起,是我没说清楚我的问题:
    我的过程如下:
       p_test(user_name in varchar2)
      is
      user_error  exceprion;
      begin
        if  user_name!='ss' then
           raise user_error;
        end;
      exception when user_error then
                raise_applicaton_error(-20000,'用户错误');
                when others then
                null;
      end;
    然后我用的不是ss用户,当然会出错了。