Setting a breakpoint Setting a debug trigger

4-128 Oracle Reports Users Guide to Building Reports

1. Choose Edit Preferences.

2. In the Preferences dialog box, on the Runtime Settings page, select Run Debug.

Click OK. 3. Click the Run Paper Layout button in the toolbar to run the report. To compile and run a report in debug mode from the command line: ■ On the rwbuilder or rwrun command line, specify RUNDEBUG=YES. For information about RUNDEBUG, see the Reference Command Line section of the Oracle Reports online Help. Usage notes Running a report in debug mode specifies that you want extra runtime checking for logical errors in the report. It checks for things that are not errors but might result in undesirable output, and displays these as warnings at runtime, before displaying the report output. Running a report in debug mode is not the same as debugging a report using the PLSQL Interpreter.

4.14.3 Setting a breakpoint

To set a breakpoint in the execution of your report:

1. If the PLSQL Interpreter is not already displayed, choose Tools PLSQL

Interpreter .

2. In the Object Navigator, single-click a compiled program unit node to display the

program unit in the Interpreter Source pane.

3. Double-click an executable statement a PLSQL construct used for conditional,

iterating, and sequential control, and for error handling. A semi-colon ; must terminate every PLSQL statement where you wish to create the break point. The breakpoint is inserted and is indicated by B00n, where n is the number of the breakpoint. When you run the program unit, execution is suspended at the line just prior to the breakpoint.

4.14.4 Setting a debug trigger

To set a debug trigger:

1. If the PLSQL Interpreter is not already displayed, choose Tools PLSQL

Interpreter . 2. In the Object Navigator, single-click a compiled program unit node to display the program unit in the Interpreter source pane. Note: Uncompiled program units are indicated by an asterisk after their name. Tip: You cannot place a breakpoint on a BEGIN, END, or NULL, statement, or on a comment. How To... 4-129 3. In the Source pane, select the line where you want to create the debug trigger, then choose Program Debugging Triggers or right-click in the Source pane and choose Trigger. 4. In the PLSQL Trigger dialog box, define the trigger: ■ If you want the trigger to fire at different location than the current program unit, select a location from the Location list. ■ Type the debug trigger in the Trigger Body text box. For example, to create a debug trigger that interrupts program execution if the local NUMBER variable my_sal exceeds 5000, enter the following as the trigger body: IF Debug.Getnmy_sal 5000 THEN raise Debug.Suspend; END IF; You must raise the DEBUG.SUSPEND exception from the DEBUG package if you want the PLSQL Interpreter to appear when this line is executed. Otherwise, Oracle Reports Builder executes the code silently and the PLSQL Interpreter does not appear.

5. Click OK to create a debug trigger for the selected line.

4.14.5 Browsing debug actions