About Debugging PL/SQL Programs and Java Stored Procedures

JDeveloper supports both PL/SQL and Java stored procedures debugging in a single IDE tool. When debugging PL/SQL, the source code you are debugging must be stored in the Oracle database. For Java stored procedures, the source code should be in your JDeveloper project and the compiled code should be deployed in the database.

Also, the way the debug action is initiated is different depending on whether you are performing local or remote debugging. When debugging PL/SQL, this distinction is described as follows:

PL/SQL and Java stored procedure debugging information is displayed in the various JDeveloper debugger windows including the Smart Data, Data, Watches, Inspector, Stack, and Classes windows. The Threads window, Heap window, and Monitors window are not applicable when debugging PL/SQL code. Press F1 or click Help in the debugger window for additional notes regarding debug information that the debugger generates.

When debugging PL/SQL, the user can use PL/SQL expressions in the Watches and Inspector windows as well as conditional breakpoints, including table element access; for example, mytable(i*10). This capability includes tables which are declared in functions, procedures, packages, and package bodies.

This topic contains information which applies to debugging both local and remote PL/SQL programs and Java stored procedures in the Oracle database:

PL/SQL Objects You Can Debug With JDeveloper

You can debug a PL/SQL program calling PL/SQL, PL/SQL calling a Java stored procedure (Oracle9i Release 2 database only), and a PL/SQL program issuing a SQL statement that fires a trigger.

You can initiate debugging PL/SQL from the following objects:

Any other PL/SQL object can be traced into as long as it meets the prerequisites, and as long as it is invoked from one of the above.

About Debugging Triggers, Java Stored Procedures, and Oracle Object Types

Consider the following when debugging triggers, Java stored procedures, and Oracle object types:

Appearance of Debug Information in Supported Oracle Databases

When debugging PL/SQL code residing in the Oracle9i Release 2 database or later, the debugger uses the database's new JPDA (Java Platform Debugger Architecture) implementation. JPDA is the industry standard for Java debugging and the JPDA implementation in the database allows you to seamlessly debug Java and PL/SQL. For debugging code residing in the Oracle8i or Oracle9i Release 1 databases, the debugger uses a different API (DBMS_DEBUG package) which provides less detail in the debugger windows.

Depending on your database version, the debug information from PL/SQL code displays differently in the JDeveloper debugger windows. However, editing PL/SQL code in the JDeveloper Code Editor is the same regardless of database version.

Differences Between Debugging on Oracle8i or Oracle9i Release 1 and Oracle9i Release 2 Databases

The main differences between debugging on the Oracle8i Release 8.1.7 or Oracle9i Release 1 databases and debugging on the Oracle9i Release 2 database are as follows

Known Issues

The following are issues encountered when debugging against an Oracle8 i or Oracle9i Release 1 database. These are limitations of the older API and will not be fixed.

Composite data types

The JDeveloper data-related windows including the Data window, the Watches window, and the Inspector windows can display variables which are scalar types such as NUMBER, VARCHAR2, and the like. Other more complex types are also displayed including:

CURSOR
The value displayed will show the flags, rowcount, and knlflags.
RECORD
The debugger cannot display an entire record. However, you can enter an expression in the Watches or Inspector windows to see a given field in the record. For example, my_rec.my_field.
TABLE of <scalar>
The debugger displays a folder (similar to how it displays an array in Java stored procedures). The user can expand the folder to see the elements. The user can right-click the folder and choose Adjust Range to enter the range of indexes that should be displayed when the folder is expanded. The default range is 1...100. The more indexes in the range (even if the elements for those indexes don't exist in the table), the longer it will take to expand the folder.
TABLE of <composite>
The debugger displays a folder (similar to how it displays an array in Java stored procedures). If the user expands the folder, the debugger may not be able to display the elements. This includes tables of tables.

Notes


Related topics

About Debugging Remote PL/SQL Programs
Moving Through Code While Debugging

 

Copyright © 1997, 2004, Oracle. All rights reserved.