insert into test values ('009',null);if @@error<>0goto err_Handle;...
print 'successful!'
returnerr_Handle:
print 'failed!';

解决方案 »

  1.   

    我用oracle的pl/sql。你是说不用自定义例外是么。我用你的方法试试
      

  2.   

    我是这样写的begin insert into test values ('009',null);if @@error<>0 thengoto my_exception;end if;dbms_output.put_line('successful!');<<my_exception>>dbms_output.put_line('failed!');end;报错说:
    ORA-06550: 第 5 行, 第 4 列: 
    PLS-00103: 出现符号 "@"在需要下列之一时:
    (-+modnotnull<an identifier>
       <a double-quoted delimited-identifier><a bind variable>avg
       countcurrentexistsmaxminpriorsqlstddevsumvarianceexecute
       foralltimetimestampintervaldate
       <a string literal with character set specification>
       <a number><a single-quoted SQL string>
    符号 "<an identifier>" 被替换为 "@" 后继续。why?????
      

  3.   

    oracle没有@@error吧?
    最好转到oracle版问
      

  4.   

    oracle的建议到oracle版去问. 处理方法与sql不同.
      

  5.   

    那我这个问题是继续放在这里,还是关闭,还是有什么方法可以直接把这个问题移至oracle论坛,这种状况扣不扣分!我第一次来这个论坛提问,还有很多不懂,各位帮帮忙了
      

  6.   

    怎么转移?我已经在oracle区发了这个贴子,也用了80分,可是莫名其妙的看不到了!!!我总共只用200,这一个问题用了我160分了,可是呢,其中一个发错了地方,还有一个发勒找不到了,好奇怪!!能不能邦我把这个贴子转移了,或者告诉我怎么转移,谢了,我实在没有积分来再提这个问题
    了谢 了!!!!!!!!