rem rem $Header: L:\\\\model\\repman40\\api\\RCS\\rmdbg.rps 1.1 1998/05/28 17:05:07 mfrobins Exp $ rem rem NAME rem rmdbg.pks - Package Header rem DESCRIPTION rem RM DeBuG support package rem rem This package provides services to aid debugging of PL/SQL code. rem It utilises ORACLE7's pipe technology and allows messages to be rem displayed in a seperate window (via a pipe reader/displayer utility) rem whilst PL/SQL code is executing. rem rem Features:- rem Enable, Disable debugging rem Debug Levels rem Some simple timing rem NOTES rem The dbms_pipe package must have been installed before rmdbg can rem be loaded. rem rem Messages are sent to a pipe named 'PIPE username/password>'. rem rem A public boolean variable 'enabled' can be used to determine if rem debugging is on or off. This allows calls to the rmdbg package rem to be made only if debugging is on. rem If 'print' is called and debug is off, messages will not be rem displayed. rem PUBLIC FUNCTION(S) rem enable : RMDBG - ENABLE debugging rem disable : RMDBG - DISABLE debugging rem timing : RMDBG - Enable/Disable timing rem print : RMDBG - Print a message rem pipename : RMDBG - Set the name of the pipe to send messages to rem prompt : RMDBG - Prompt pipe listener for reply rem to_number : RMDBG - Convert boolean value to {0,1} rem trace : RMDBG - Write trace information to a file. rem close_trace : RMDBG - Close trace file. rem flush_trace : RMDBG - Force buffered info to the disk. rem write_file : RMDBG - Write information to a file. rem rem MODIFIED (MM/DD/YY) rem aloevold 04/11/96 - add trace to file rem jhyde 02/10/94 - add to_number(b boolean) rem dcaruana 12/17/93 - Add Debug Switches create or replace package rmdbg as -- -- Public Constants -- SW_NONE CONSTANT binary_integer default -2; -- No switches SW_ALL CONSTANT binary_integer default -1; -- All switches SW_INFO CONSTANT binary_integer default 1; -- Information SW_TRACE CONSTANT binary_integer default 2; -- Trace -- -- Public Types -- type bitflags is table of number index by binary_integer; type varchar2s is table of varchar2(80) index by binary_integer; type switches is record ( cnt number -- Switch count ,name varchar2s -- Switch name ,bitflag bitflags -- Switch bitflag ,pipename varchar2s -- Switch Pipename ); -- -- Public Defines -- enabled boolean; -- Debug Enabled Flag -- -- Procedure Prototypes -- /*----------------------------- enable -----------------------------------*/ /* enable : RMDBG - ENABLE debugging */ procedure enable( dlevel in binary_integer default null, dswitch in binary_integer default null ); /*---------------------------- disable -----------------------------------*/ /* disable : RMDBG - DISABLE debugging */ procedure disable; /*---------------------------- is_enabled --------------------------------*/ /* is_enabled : RMDBG - Check whether debugging level exceeds value */ function is_enabled( dlevel in binary_integer default 0 ,dswitch in binary_integer default SW_ALL ) return boolean; /*------------------------- initialise_switches -------------------------*/ /* initialise_switches : RMDBG - Initialise Debug Switches */ procedure initialise_switches( debug_switches in rmdbg.switches ); /*----------------------------- timing -----------------------------------*/ /* timing : RMDBG - Enable/Disable timing */ procedure timing( flag in boolean default true, duration in boolean default false ); /*-------------------------- catch_abort ----------------------------------*/ /* catch_abort : RMDBG - Enable/Disable catching of abort */ procedure catch_abort( flag in boolean default true ); /*--------------------------- send_abort ----------------------------------*/ /* send_abort : RMDBG - Send abort signal */ procedure send_abort( message in varchar2 default null ); /*----------------------------- prompt ------------------------------------*/ /* prompt : RMDBG - Prompt pipe listener for reply */ procedure prompt(text in varchar2, reply out varchar2); /*----------------------------- print ------------------------------------*/ /* print : RMDBG - Print a message */ procedure print( text in varchar2, dlevel in binary_integer default 0 , flush in binary_integer default 240 , dswitch in binary_integer default SW_INFO ); /*---------------------------- pipename ----------------------------------*/ /* pipename : RMDBG - Set the name of the pipe to send messages to */ procedure pipename( newname in varchar2 , dswitch in binary_integer default null ); /*---------------------------- to_number ---------------------------------*/ /* to_number : RMDBG - Convert a boolean value to {0,1} */ function to_number(b in boolean) return binary_integer; /*---------------------------- trace -------------------------------------*/ /* trace : RMDBG - Write trace information to a file. */ procedure trace(info in varchar2,rows in number,sqlinfo in boolean default false); /*---------------------------- trace -------------------------------------*/ /* trace : RMDBG - Write trace information to a file. */ procedure trace(info in varchar2); /*---------------------------- close -------------------------------------*/ /* close : RMDBG - Close trace file. */ procedure close_trace; /*---------------------------- flush_trace -------------------------------*/ /* flush_trace : RMDBG - Force buffered info to the disk. */ procedure flush_trace; /*---------------------------- write_file -------------------------------*/ /* write_file : RMDBG - Write to server side file. */ procedure write_file(info in varchar2); end rmdbg; /