天天看点

oracle 存储过程游标中处理并记录异常

游标中遇到异常,记录到日志表,继续执行下一个,不跳出游标;

 exception

      when others then

        v_sqlcode := sqlcode;

        v_sqlerrm := sqlerrm;

        dbms_output.put_line(sqlerrm);

        insert into hz_log values (systimestamp, v_sqlerrm, v_dblink);

        commit;

这都忘了,再记记。

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/29519108/viewspace-2137032/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/29519108/viewspace-2137032/