You can easily execute a SQL statement embedded within PL/SQL. Toad extracts the SQL statement and adjusts the syntax as necessary. Any identifier which is not a column of a referenced object is treated as a bind variable. If the identifier is a reference to a PL/SQL constant, the bind variable value defaults to the constant value.
To execute a SQL statement within PL/SQL
Place the cursor in the statement and press SHIFT+F9. A new window displays with the extracted SQL statement.
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.
You can debug PL/SQL and SQL scripts in Toad.
Notes:
Types of Debugging
Toad provides the following debug features:
| DBMS Debugger |
Debugs PL/SQL. Using the Debugger, you can set breakpoints, watches, and see call stacks. In addition, you can view DBMS output.
Note: When using the PL/SQL Debugger and connecting to a RAC instance, you must have the TNSNAMES entry for the instance with the server directed the use connection or session here. Or, you must connect directly to an instance of the cluster without letting the server assign an instance. |
| JDWP Debugger |
Toad also provides a JDWP debugger for debugging PL/SQL. You must configure the JDWP Debugger prior to initial use. See Configure JDWP Debugger for more information. To use the JDWP debugger, select Debug | JDWP Debugger. |
| Script Debugger |
Debugs SQL scripts. You can set breakpoints, run to cursor, step over, trace into, and halt execution of your scripts. |
| Attach External Session |
External debugging allows you to debug PL/SQL that is run from an external session, such as another Toad window, SQL*Plus, or any other development tool which calls Oracle stored procedures. |
Debugging in Toad requires you to select one type of debugging at a time for all database instances open per instance of Toad. For example, if you have three database connections in one instance of Toad, they must all be in the same debugging state. If you then opened another instance of Toad, with the same or different connections, they could be in a different debugging state.
Compile with Debug Information
To use the debugger fully with PL/SQL or Java packages, you need to compile your object with debug information. Start Debugging
In addition, if you are debugging an object that has dependent objects, you cannot step into the dependents unless they, too, are compiled with debug information. Handle Dependencies and References
Compile without Debug Information
To reduce the size of your code when it is ready for production, you should compile without debug information. Prepare PL/SQL Code for Production.
Get more information on Debugging
- Toad's online help includes tutorials on how to debug. See Debugging a Procedure or Function Tutorial in the online help for more information.
- See the Debug section of the Table of Contents in the online help for additional topics on debugging.