After presenting the SQL Developer PL/SQL debugger for about an hour yesterday at KScope12 in San Antonio, my boss came up and asked, “Now, would you really want to know what the Smart Data panel does?”

Apparently I had ‘made up’ my own story about what that panel’s intent is based on my experience with it. Not good Jeff, not good. It was a very small point of my presentation, but I probably should have read the docs.

The Smart Data tab displays information about variables, using your Debugger: Smart Data preferences. You can also specify these preferences by right-clicking in the Smart Data window and selecting Preferences.

Debugger Smart Data Preferences, control number of variables to display

The Smart Data panel auto-inspects the last X accessed variables. So if you have a program with 26 variables, instead of showing you all 26, it will just show you the last two variables that were referenced in your program.

If you were to click on the ‘Data’ debug panel, you’ll see EVERYTHING. And if you only want to see a very specific set of values, then you should use Watches.

The Smart Data Panel

As I step through the code, the variables being tracked change as they are referenced. Only the most recent ones display. This is controlled by the ‘Maximum Locations to Remember’ preference.

Step through the code, see the latest variables accessed

The Data Panel

All variables are displayed. Might be information overload on large PL/SQL programs where you have many dozens or even hundreds of variables to track.

Shows everything all the time

Watches

Watches are added manually and only show what you ask for.

Data on Demand – add a watch to track a specific variable

Remember, you can interact with your data

If you want to do more than just watch, you can mouse-right on a data element, and change the value of the variable as the program is running. This is one of the primary benefits to debugging over using DBMS_OUTPUT to track what’s happening in your program.

Change the values while the program is running to test your ‘What if?’ scenarios
Author

I'm a Distinguished Product Manager at Oracle. My mission is to help you and your company be more efficient with our database tools.

10 Comments

  1. Using Acceptable Legal PL/SQL Expressions in the Debugger

    If we are debugging PL/SQL, then we can use PL/SQL expressions in the Watches window, Inspector window, Breakpoint conditions, and Breakpoint Log expressions.

    examples of acceptable legal PL/SQL expressions that you can use in the debugger.
    PL/SQL Expression Example

    Field Access myrecord.Dept_No
    Table element mytable(3)
    Comparison operation myrecord.Dept_No = 100 , mytable(3) > 7, employee.salary BETWEEN 25000 AND 50000
    Arithmetic operation counter * size, x + y + z
    Logical operation employee.exempt AND employee.active , employee.exempt OR employee.active
    Package variable name $Oracle.Package.HR.MyPackage.MyVariable
    Fully-qualified Package name $Oracle.Package.HR
    PackageBody variable name $Oracle.PackageBody.HR.MyPackage.MyVariable
    Fully-qualified PackageBody name $Oracle.PackageBody.HR

    Is there any way I can access these syntax/variable/ collection in my PLSQL code for some purpose. I mean I need to use collection.record.element and collection.record.element.value for some purpose.

  2. Hi guys, coul you tell me, How can I enable/show the smart data monitor??
    I´m working in a oaf project.
    Thanks so much!

  3. Mohammed Ismail Reply

    I have a sql Type object that is fetching correct data. During debug when i try to see the data it is holding, there is no data displayed at the Data window for that object. Value is shown with space and datatype is shown as opaque. Can u help me resolving the same.

    I am using Oracle 12c,
    Sql developer Version : 4.1.3.20

    thanks
    Mohammed Ismail

  4. Eva, can you execute the stored procedure?

    Is the ‘Debug’ button in the procedure editor toolbar also upgraded? Can you send me a screenshot of what you’re seeing? Or upload one to a free image service and send me a link?

  5. Hi, Jeff! I have a big problem: dedug actions are allways disabled. Don’t know why and cannot cope with it. The sql developer version is 3.0.04. Really hope you will help me. Thank you

    • 2 things:

      1. Can you upgrade? Versions 3.1, 3.2, and now 3.2.1 have been released since your version
      2. Have you the proper privs to debug? DEBUG CONNECT SESSION is a show-stopper if you don’t have it in 10g and higher
    • Jeff, thank you, but unfortunately it doesn’t help. I have privs and the version is 3.2.10.09. Have no ideas why (

Write A Comment