can anybody help me?
in the sub procedure, v_a has no scope as it's part of the parent proc, but v_x does as it's declared locally..you can see this happen dynamically as you step through the code if you look at the Data panel
Thank you Jeff,
I like to use sub procedures and only for debugging I have to define them twice or more: in every sub procedure - that's not good. Do you know if any future SQLdeveloper version will debug variables definded in the parent proc also in sub procs?
Many thanks Brigitte
Jeff Smith SQLDev PM wrote:
in the sub procedure, v_a has no scope as it's part of the parent proc, but v_x does as it's declared locally
Perhaps you meant that v_a does not have LOCAL scope? Because v_a does have GLOBAL scope for the subunits.
If it had NO scope then the subunits wouldn't be able to reference it or assign to it.
Scope and Visibility of PL/SQL Identifiers
References to an identifier are resolved according to its scope and visibility. The scope of an identifier is the region of a PL/SQL unit from which you can reference the identifier. The visibility of an identifier is the region of a PL/SQL unit from which you can reference the identifier without qualifying it.
An identifier declared in a PL/SQL unit is local to that unit and global to its subunits. If a subunit redeclares a global identifier, then inside the subunit, both identifiers are in scope, but only the local identifier is visible. To reference the global identifier, the subunit must qualify it.
Example 2-26 that follows that quote shows an example of a subunit qualifying a global identifier since the subunit redefines it:
8 IF check_credit.rating <= limit THEN
The outer unit name is 'check_credit'.
Qualified variables can't be seen either in sql*developer (or Toad) even if they are added as watches. Maybe it is a limitation of the DMBS_DEBUG package.
I'm probably not using the right words, but inside the sub proc, I don't believe the parent proc variables have any visibility for the debugger.
What we're showing is what DBMS_JDWP debug package shows.
I'll consult with the PL/SQL team to make sure we're not missing something on the client side.
Wow that's new for that i can qualify a identifier. I will try it out as soon as I have time to to this.
That would be my next question: how can I qualify v_a in the sub procedure? with stuerk_debug.v_a?
I just try to degbug stuerk_debug.v_a in sub proc sdebug_nodata but I see only question marks - no data. I can watch only the variable which I define in the sub proc.
I hope the PL/SQL team can find any work around.
Dev reminds me this SHOULD work. Will log a bug. Thanks for the patience folks.