日期:2014-05-16  浏览次数:20463 次

存储过程打印出错行号只支持Oracle10g及以上版本
存储过程打印出错行号只支持Oracle10g及以上版本


--存储过程打印出错行号只支持Oracle10g及以上版本
begin
   do something;
exception when others then                                                 
    dbms_output.put_line(sqlcode);--Oracle内置变量,错误代码
    dbms_output.put_line(sqlerrm);--Oracle内置变量,错误详细描述
    dbms_output.put_line(dbms_utility.format_error_backtrace());--出错行号
end;