The PL/SQL Interpreter can be invoked from report code (triggers, user-named program units, libraries, and so on) by creating debug actions in the code. These are instructions that track the execution of PL/SQL program units so they can be monitored.
Each debug action you create is automatically assigned a unique numeric ID. While debugging, you can refer to this ID to browse, display, or modify a specific debug action with Reports Builder debug commands.
You can display detailed information about one or more debug actions, including its ID, source location, and whether or not it is enabled. You can temporarily disable specific debug actions and then re-enable them later if necessary.
There are two types of debug actions: breakpoints and debug triggers.
Breakpoints suspend execution at a specific source line of a program unit, passing control to the PL/SQL Interpreter.
Create breakpoints to identify specific debugging regions. For example, create a breakpoint at lines 10 and 20 to debug the code within this region.
With breakpoints, suspension occurs just before reaching the line on which the breakpoint is specified. At this point, use the PL/SQL Interpreter's features to inspect or modify program state. Once satisfied, resume execution with the GO or STEP commands, or abort execution using the RESET command.
Debug Triggers are a general form of debug action that associate a block of PL/SQL code with a specific source line within a program unit. When a debug trigger is encountered, Reports Builder executes the debug trigger code.
Create a debug trigger to execute a block of PL/SQL code provided at debug time in any of the following cases:
When program execution reaches a single line in a program unit (for example, the current source location, line 5, line 23, and so on).
Every time the PL/SQL Interpreter takes control (that is, whenever it suspends program execution due to a breakpoint, program stepping, and so on).
At every PL/SQL source line being run.
Debug triggers are especially useful as conditional
breakpoints. You can raise the exception DEBUG.BREAK from within a trigger.
For example, the debug trigger shown below establishes a conditional breakpoint
on line 10 of my_proc
, which
will be reached only if the local NUMBER variable my_sal
exceeds 5000:
PL/SQL>line 10 is
+> IF Debug.Getn('my_sal') > 5000 THEN
+> Raise Debug.Suspend;
+> END IF;
Disabling and enabling debug actions
Copyright © 1984, 2005, Oracle. All rights reserved.