Oracle provides a package, called DBMS_OUTPUT, which is specifically designed with functions for debugging PL/SQL code. It uses a buffer that your PL/SQL code writes into, and then a separate process queries the buffer out and displays the contents.
The Editor has a Right-Click menu option that will generate a DBMS_OUTPUT statement for a highlighted variable. The same menu has an option to create a blank DBMS_OUTPUT statement.
To generate an output line from a variable
- Highlight the variable in the Editor.
Right-click and select Output Statements | Make Output Statement.
Note: The statement is created on the clipboard.
- Paste the statement in your code where you want it.
To generate a blank output statement
- In the Editor, right click and select Output Statements | Blank Output Statement.
- Paste the statement in your code.
To view DBMS Output
On the main toolbar, select View | DBMS Output.
DBMS_OUTPUT results only display after the procedure has completed execution, not while you are single stepping through the code. In nested procedure calls, all procedures must have run to completion before any DBMS Output content is displayed.