This Is A FineDay

  BlogJava :: 首页 :: 新随笔 :: 联系 :: 聚合  :: 管理 ::
  93 随笔 :: 0 文章 :: 69 评论 :: 0 Trackbacks

SET SERVEROUTPUT ON
BEGIN
     DBMS_OUTPUT.put_line('A BEGIN');
       BEGIN
            DBMS_OUTPUT.put_line('B BEGIN');
              DECLARE
                     v_CallStack      VARCHAR2(2000);
              BEGIN
                   DBMS_OUTPUT.put_line('C BEGIN');
                   v_CallStack := DBMS_UTILITY.format_call_stack;
                   DBMS_OUTPUT.put_line(v_CallStack);
                   DBMS_OUTPUT.put_line('C END');
              END;
            DBMS_OUTPUT.put_line('B END');
       END;
     DBMS_OUTPUT.put_line('A END');
END;

--DBMS_UTILITY.format_call_stack
SET SERVEROUTPUT ON
DECLARE
       v_CallStack      VARCHAR2(2000);
BEGIN
       DBMS_OUTPUT.put_line('C BEGIN');
       v_CallStack := DBMS_UTILITY.format_call_stack;
       DBMS_OUTPUT.put_line(v_CallStack);
       DBMS_OUTPUT.put_line('C END');
END;
--结果
/*
C BEGIN
----- PL/SQL Call Stack -----
  object      line  object
  handle    number  name
135576A4         5  anonymous block

C END
*/


/**
   CREATE OR REPLACE PROCEDURE C AS
        v_CallStack      VARCHAR2(2000);
   BEGIN
        v_CallStack := DBMS_UTILITY.format_call_stack;
   END C;
  
   CREATE OR REPLACE PROCEDURE B AS
   BEGIN
        C;
   END B;
  
   CREATE OR REPLACE PROCEDURE A AS
   BEGIN
        B;
   END A;
 
 
--类似结果
C BEGIN
----- PL/SQL Call Stack -----
  object      line  object
  handle    number  name
135576A4         4  PROCEDURE C
135576A4         5  PROCEDURE B
135576A4         5  PROCEDURE A
135576A4         5  anonymous block

C END
*/

posted on 2007-03-09 17:20 Peter Pan 阅读(825) 评论(0)  编辑  收藏 所属分类: DB

只有注册用户登录后才能发表评论。


网站导航: