Chat now with support
Chat with Support

Toad for Oracle 12.12 - Getting Started Guide

Table of Contents Welcome to Toad Toad Resources Required Privileges Create and Manage Database Connections Editor Basics Schema Browser Basics Data Grid Basics Work with Data Work with Database Objects Work with Code
Write Statements and Scripts Work with the Query Builder Execute Statements and Scripts Save Statements (SQL Recall) Work with PL/SQL Objects Debug Analyze Code Optimize SQL
Customize your Toad Environment Use Other Quest Software Products with Toad

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.

To open the DBMS Output window

On the main toolbar, select View | DBMS Output.


Edit DBMS Output

You can edit the output display in the DBMS Output window. This allows you to note what you did to receive the output.

For example, when debugging a procedure named MyProc that expects a single number parameter, you can execute the procedure from an Editor window with the following statement:

begin MYPROC(1); end;

Prior to executing the above, you can document the call in the DBMS Output with a comment:

Calling MyProc with 1

Then turn DBMS Output ON and execute MyProc. The DBMS_OUTPUT statements will display after your notes about the call.


Create and Run Unit Tests

After you run PL/SQL with debugging, you can create a unit test for the active object in the PL/SQL Results window of the Editor. The test is created in the Code Tester for Oracle repository, which must exist in the connected database.

You can also run tests in this window. Toad supports a subset of the Code Tester functionality for creating a new test, but Toad provides a direct link to Code Tester if you need more advanced functionality.

To create and run tests, the following are required:

  • There must be a Code Tester repository on the database to which you are connected from Toad, and the Code Tester repository must be a version that is supported by the version of Toad that you are using. The repository version must be 3.0 or greater.
  • The feature is enabled only if there are results in the PL/SQL Results window.
  • A connection to the database that contains the object must be defined in Code Tester. The test is created under the node for that object on the Tests panel in Code Tester.
  • To create a new test, all input and output values must be of a type supported by Code Tester.

Note: Code Tester does not have to be running to create or run tests in Toad.

To create a unit test in Code Tester

  1. Click (Execute PL/SQL with Debugger) in the Editor toolbar.
  2. Select the PL/SQL Results tab then wait for the run to finish.
  3. Click (Create Unit Test) in the PL/SQL Results window. The new button opens the Create Test dialog.
  4. In the Create Test Case dialog, complete the test information. You can change values as needed.

    Note: By default, you are prompted to create a new test definition when you create the test case.

If you cannot create a test, the Code Tester repository on the database is not a supported version or does not exist. Select Attach to Existing to attach the test case to an existing definition.

To run a test from Toad

Click (Execute Code Tester for Oracle tests...).

To open Code Tester

Click on the PL/SQL Results toolbar or on the Code Tester Results dialog (after you run the test).

To add unit tests to Team Coding

You can include your unit tests in your Team Coding projects. This enables you to manage the revision history of your tests in the same way that you manage the revisions of your other controlled objects. The user/schema who created the tests in Toad must be included in (or added to) the Team Coding project for the tests to be controlled. For more information, see Configure Team Projects.


Debug Scripts

Toad provides an intuitive and efficient way to write, run, and test your SQL and PL/SQL code. Toad supports efficient code management for a single developer or a whole team of developers.


Related Documents

The document was helpful.

Select Rating

I easily found the information I needed.

Select Rating