• <bdo id='8Iedl'></bdo><ul id='8Iedl'></ul>

    1. <small id='8Iedl'></small><noframes id='8Iedl'>

        <legend id='8Iedl'><style id='8Iedl'><dir id='8Iedl'><q id='8Iedl'></q></dir></style></legend>

        <tfoot id='8Iedl'></tfoot>
      1. <i id='8Iedl'><tr id='8Iedl'><dt id='8Iedl'><q id='8Iedl'><span id='8Iedl'><b id='8Iedl'><form id='8Iedl'><ins id='8Iedl'></ins><ul id='8Iedl'></ul><sub id='8Iedl'></sub></form><legend id='8Iedl'></legend><bdo id='8Iedl'><pre id='8Iedl'><center id='8Iedl'></center></pre></bdo></b><th id='8Iedl'></th></span></q></dt></tr></i><div id='8Iedl'><tfoot id='8Iedl'></tfoot><dl id='8Iedl'><fieldset id='8Iedl'></fieldset></dl></div>

        Oracle PL/SQL:如何获取堆栈跟踪、包名称和过程名称

        Oracle PL/SQL: how to get the stack trace, package name and procedure name(Oracle PL/SQL:如何获取堆栈跟踪、包名称和过程名称)
        <i id='r7Tb4'><tr id='r7Tb4'><dt id='r7Tb4'><q id='r7Tb4'><span id='r7Tb4'><b id='r7Tb4'><form id='r7Tb4'><ins id='r7Tb4'></ins><ul id='r7Tb4'></ul><sub id='r7Tb4'></sub></form><legend id='r7Tb4'></legend><bdo id='r7Tb4'><pre id='r7Tb4'><center id='r7Tb4'></center></pre></bdo></b><th id='r7Tb4'></th></span></q></dt></tr></i><div id='r7Tb4'><tfoot id='r7Tb4'></tfoot><dl id='r7Tb4'><fieldset id='r7Tb4'></fieldset></dl></div>

            <tbody id='r7Tb4'></tbody>
          <tfoot id='r7Tb4'></tfoot>
            <bdo id='r7Tb4'></bdo><ul id='r7Tb4'></ul>

                • <legend id='r7Tb4'><style id='r7Tb4'><dir id='r7Tb4'><q id='r7Tb4'></q></dir></style></legend>

                  <small id='r7Tb4'></small><noframes id='r7Tb4'>

                • 本文介绍了Oracle PL/SQL:如何获取堆栈跟踪、包名称和过程名称的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  有时异常返回类似:ORA-06502:PL/SQL:数字或值错误:字符串缓冲区太小".

                  Sometimes the exception returns something like: "ORA-06502: PL/SQL: numeric or value error: character string buffer too small".

                  它不是那么易读,因为它既不报告表、列和它试图写入的值.

                  It's not so readable since it doesn't report neither the table, the column and the value it tried to write.

                  在异常发生或被捕获时获取当前过程名称会很有用.

                  it would be useful to get the current procedure name at the moment the Exception happened or is catched.

                  我如何获得它?

                  推荐答案

                  您可能想要 DBMS_UTILITY.FORMAT_ERROR_BACKTRACE 函数

                  You probably want DBMS_UTILITY.FORMAT_ERROR_BACKTRACE function

                  SQL> ed
                  Wrote file afiedt.buf
                  
                    1  create or replace procedure p1
                    2  is
                    3  begin
                    4    raise_application_error( -20001, 'Error 1', true );
                    5* end;
                  SQL> /
                  
                  Procedure created.
                  
                  SQL> create or replace procedure p2
                    2  as
                    3  begin
                    4    null;
                    5    p1;
                    6  end;
                    7  /
                  
                  Procedure created.
                  
                  SQL> begin
                    2    p2;
                    3  exception
                    4    when others then
                    5      dbms_output.put_line( dbms_utility.format_error_backtrace );
                    6  end;
                    7  /
                  ORA-06512: at "SCOTT.P1", line 4
                  ORA-06512: at "SCOTT.P2", line 5
                  ORA-06512: at
                  line 2
                  
                  
                  PL/SQL procedure successfully completed.
                  

                  这篇关于Oracle PL/SQL:如何获取堆栈跟踪、包名称和过程名称的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  Why Mysql#39;s Group By and Oracle#39;s Group by behaviours are different(为什么 Mysql 的 Group By 和 Oracle 的 Group by 行为不同)
                  Creating a flattened table/view of a hierarchically-defined set of data(创建分层定义的数据集的扁平表/视图)
                  MySQL: how to do row-level security (like Oracle#39;s Virtual Private Database)?(MySQL:如何做到行级安全(如 Oracle 的 Virtual Private Database)?)
                  What is the best way to enforce a #39;subset#39; relationship with integrity constraints(强制执行具有完整性约束的“子集关系的最佳方法是什么)
                  Split String by delimiter position using oracle SQL(使用 oracle SQL 按分隔符位置拆分字符串)
                  How to unfold the results of an Oracle query based on the value of a column(如何根据列的值展开Oracle查询的结果)

                  <legend id='Dm97Z'><style id='Dm97Z'><dir id='Dm97Z'><q id='Dm97Z'></q></dir></style></legend>

                          <tbody id='Dm97Z'></tbody>
                        <tfoot id='Dm97Z'></tfoot>

                          <small id='Dm97Z'></small><noframes id='Dm97Z'>

                            <bdo id='Dm97Z'></bdo><ul id='Dm97Z'></ul>
                          • <i id='Dm97Z'><tr id='Dm97Z'><dt id='Dm97Z'><q id='Dm97Z'><span id='Dm97Z'><b id='Dm97Z'><form id='Dm97Z'><ins id='Dm97Z'></ins><ul id='Dm97Z'></ul><sub id='Dm97Z'></sub></form><legend id='Dm97Z'></legend><bdo id='Dm97Z'><pre id='Dm97Z'><center id='Dm97Z'></center></pre></bdo></b><th id='Dm97Z'></th></span></q></dt></tr></i><div id='Dm97Z'><tfoot id='Dm97Z'></tfoot><dl id='Dm97Z'><fieldset id='Dm97Z'></fieldset></dl></div>