/* Author:        Tom Berthoff                                           */
/* Date created:  08/06/2002                                             */
/* Purpose:                                                              */
/*                                                                       */
/* Acknowledgements:                                                     */
/* Much of the code in this package is borrowed from my former colleague */
/* Sander Smit, who borrowed much of it from Steven Feuerstein. The      */
/* basic concepts can be found in the book "Oracle Built-In Packages" by */
/* Feuerstein, Dye and Beresniewicz.                                     */
/*                                                                       */
/* Please let me know if you find any bugs, problems, or better ways of  */
/* doing things. I can be reached at bertht@hhcainc.com.                 */
/*                                                                       */
/* This package uses DBMS_PIPE to transmit debugging messages from one   */
/* Oracle session to another in the same database.                       */
/* The HHCA debug package (package name 'P' ) allows developers to embed */
/* debug log messages in PL/SQL code, to turn the debug logging on and   */
/* off dynamically, and to read out the log messages into a database     */
/* table using the Oracle built-in package DBMS_PIPE.                    */

INSTRUCTIONS FOR USING THE P DEBUGGING PACKAGE.

Create the two necessary tables using the tables.sql script.

The procedure and function in the procedures.sql script need to be put in a package separate from the P package. We use a utilities package called P_UTIL, but you can call it what you like. The code in the P package will need to be modified to use the new package name.

Create the package using the p.pks and p.pkb scripts.

I have included the L_P library for use in a form. The form you will have to build yourself based on the REMIT_LOGGINGS table. The important columns in REMIT_LOGGINGS are the RL_ENTRY_DATE and the RL_DESCR columns. If you sort by RL_ENTRY_DATE ascending, you will get the messages in the order they were written. Buttons can be included to read and delete messages.

Additionally, the L_P library can be used to add a button bar button to turn debugging on and off, if you like. We've set up functionality to only display the button if the user is a programmer and the current database is not production.
