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.
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.
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.
Watches
Watches are added manually and only show what you ask for.
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.
10 Comments
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.
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!
start a debug session
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
compile the type object WITH DEBUG
Can I use functions like NVL in watches? It shows “?” Thanks
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?
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:
Jeff, thank you, but unfortunately it doesn’t help. I have privs and the version is 3.2.10.09. Have no ideas why (