Table of Contents
Debug.f for debugging PL/SQL application
About
It's a package designed to allow you to add logging or trace statements to a PL/SQL application.
Example
CREATE PROCEDURE p ( p_owner IN VARCHAR2, p_object_name IN VARCHAR2) AS l_status NUMBER := 0 ; BEGIN Debug.f ('Entering procedure, inputs "%s", "%s" ) .... some code .... Debug.f ('Normal EXIT, status = %d', l_status ); end;
If the debug package where told to generate a trace file via a call to debug.init, you will have this :
12062002 213953(P.PROCEDURE 5) Enter procedure inputs "A", "B" 12062002 213955(P.PROCEDURE 56) Normal exit, status = 0
Where :
- 12062002 is the date MMDDYYYY format
- 213953 is the time HH24MISS format
How to install it
- Download it : debugf.zip
- create a utility user
CREATE USER utility identified BY utility; grant CREATE session, CREATE PROCEDURE, CREATE TABLE, CREATE TRIGGER TO utility; ALTER USER utility DEFAULT tablespace users quota unlimited ON users;
- run install_debug in that schema
- create a public synonym for debug