08-dbug2.sql

来自「《Oracle8i PL/SQL程序设计》附源码」· SQL 代码 · 共 38 行

SQL
38
字号
REM 08-DBUG2.SQL
REM This file contains the second version of the Debug package, used
REM in Chapter 8 of "Oracle PL/SQL Programming".

REM This is version 1.0 of this file, updated 2/18/96.
REM Comments and questions should go to Scott Urman, at
REM surman@us.oracle.com.


CREATE OR REPLACE PACKAGE Debug AS
  PROCEDURE Debug(p_Description IN VARCHAR2,
                  p_Value IN VARCHAR2);

  PROCEDURE Reset;
END Debug;
/

CREATE OR REPLACE PACKAGE BODY Debug AS
  PROCEDURE Debug(p_Description IN VARCHAR2,
                  p_Value IN VARCHAR2) IS
  BEGIN
    DBMS_OUTPUT.PUT_LINE(p_Description || ': ' || p_Value);
  END Debug;

  PROCEDURE Reset IS
  BEGIN
       /* Disable the buffer first, then enable it with the
       maximum size. Since DISABLE purges the buffer, this
       ensures that we will have a fresh buffer whenever
       Reset is called. */
    DBMS_OUTPUT.DISABLE;
    DBMS_OUTPUT.ENABLE(1000000);
  END Reset;
BEGIN /* Package initialization code */
  Reset;
END Debug;
/

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?