This discussion is archived
10 Replies Latest reply: Nov 3, 2011 3:02 PM by 74641 RSS

tool tip for global vars?

74641 Newbie
Currently Being Moderated
I started using Raptor in 2006. But, several years ago I took a position in a shop that uses a full-on version of Toad and I haven't used it since then. Recently I had occasion to do something that Raptor will do but Toad won't. So - I installed the latest version of Raptor. It's really improved in many ways, but it doesn't do one thing in 3.0.04.34 that I can do in 1.5.x (which I installed next...). It's such an obvious thing to want that I feel I must be missing something.

It has to do with hovering over a variable to discern it's value while in debug. Local vars come up fine - but globals do not. Unfortunately, the application I'm working on was built in the nineties around hundreds of global variables. So, not having this feature limits this versions' usefulness to me. And, again - globals come up fine in 1.5.4, so I suspect my problem is in configuration somewhere! What am I missing?

Thanks!
  • 1. Re: tool tip for global vars?
    -K- Guru
    Currently Being Moderated
    How/where are these so-called "globals" defined?

    K.
  • 2. Re: tool tip for global vars?
    74641 Newbie
    Currently Being Moderated
    Thanks for responding.

    They're at the package header level in a package that is seperate from the one I'm attempting to step through.
  • 3. Re: tool tip for global vars?
    74641 Newbie
    Currently Being Moderated
    Well, it's been a week and no answer. I suppose no-one (even Oracle?) knows. Thanks anyway for anyone who read and thought, but didn't know. I appreciate your consideration.
  • 4. Re: tool tip for global vars?
    Gary Graham Expert
    Currently Being Moderated
    Hi,

    I did a little testing on 1.5.5 and 3.0.04. It seems this feature works on both. I used Windows XP and list my test case below. The things I noticed on both versions:

    1) There are actually two "tool tips": a regular tool tip with just metadata, plus a second tip-widget that displays the current value.
    2) The second tip is of the form "<variable> = <value>" in 1.5.5, but has a single-line tabular form in 3.0.04. It includes the datatype.
    3) The pure metadata tool tip is never available for global variables outside of the package being debugged.
    4) An outside-of-package global variable is not listed in the Smart Data tab or active for a tool tip until code that references it has been stepped past.
    5) Even then, the UI is a bit finicky in the displaying value.
    6) In 3.0.04, hovering on the first character of the global variable shows the metadata tip, then just left of that for the value tip.

    Here is my test case (you might have gotten a quicker response if you had provided one):
    create or replace
    package globalvars as
      g_version number(3) := 999;
    end globalvars;
    
    create or replace
    package testglblv_pkg as
      p_version number(3) := 0;
      procedure testout (param1 in varchar2, paramout out varchar2);
    end testglblv_pkg;
    
    create or replace
    package body testglblv_pkg as
      procedure testout (param1 in varchar2, paramout out varchar2) as
        xxx varchar2(30) := '';
        begin
          for i in 1..10 loop
            dbms_output.put_line(xxx    || to_char(           p_version,'999') ||
                                 param1 || to_char(globalvars.g_version, '999'));
            xxx := xxx || '.';
            globalvars.g_version := globalvars.g_version - 1;
            p_version := p_version - 1;
          end loop;
          paramout := xxx;
        end testout;
    end testglblv_pkg;
    Regards,
    Gary
    SQL Developer Team
  • 5. Re: tool tip for global vars?
    Gary Graham Expert
    Currently Being Moderated
    After a little more investigation, I can add the following:

    5a) On older, low memory systems (512 MB, SQL Dev 3.0/Oracle 10gXE/WinXP) tool tip appearance is even more problematic, but with patience I did get it to work.
    6a) Hovering on outside-of-package global variables does work, but you must hover just to the left of name, apparently over a blank space. So, for example,
      param1 || to_char(globalvars.g_version, '999'));
    if there are no blanks to hover over before the global name, no value tool tip appears, whereas
      globalvars.g_version := globalvars.g_version - 1
    in this case it works fine. I also re-checked on Linux and same behavior applies.

    Other required conditions are:
    a) The package containing the outside-of-package global variable(s) must also be compiled for debug.
    b) Required privileges for debugging are: DEBUG CONNECT SESSION and DEBUG ANY PROCEDURE.
    c) Tools|Preferences|Debugger|Show Tool Tip in Code Editor While Debugging must be enabled.

    If none of this is of help to you, please provide more information on your environment, configuration and, if relevant, a specific test case.

    Hope this helps,
    Gary
  • 6. Re: tool tip for global vars?
    74641 Newbie
    Currently Being Moderated
    Gary - thank you very much for your interest and thoroughness! I appreciate it. Using your code, I got the same results that you did. That puzzled me since when I checked in my own code - I still can't ever read the globals, even if I hover to the left of the var in a blank. So, as you suggested, I setup my own test that I could send you if it still exhibited the original behavior.

    Basically, I used your code (although I renamed one of your packages to cause it to reside close to the other in my (large) schema). But, I initialized your global var in a procedure routine - and that seems to be how to cause the behavior (or, lack of it). I also setup my own global (this time a varchar2) and initialized it the same way. Using this code I am no longer able to hover over the var at any location, space or no, and see it's value. I'll be interested to know whether you get the same results that I do.

    As requested, I am running against Oracle Database 10g Enterprise Edition Release 10.2.0.3.0. My client machine is XP version 2002 service pack 3. I am testing using SQL Developer ver. 3.0.04.


    CREATE OR REPLACE PACKAGE testglobalvars
    AS
    -- g_version number(3) := 999;
    g_version number(3);
    g_vchar varchar2(10);

    PROCEDURE init;
    END testglobalvars;

    CREATE OR REPLACE PACKAGE BODY testglobalvars
    AS

    PROCEDURE init
    AS
    BEGIN
    g_version := 0;
    g_vchar := ' ';
    END;

    END testglobalvars;

    CREATE OR REPLACE PACKAGE testglblv_pkg
    AS
    p_version number(3) := 0;

    PROCEDURE testout (param1 in varchar2, paramout out varchar2);
    END testglblv_pkg;

    CREATE OR REPLACE PACKAGE BODY testglblv_pkg AS
    PROCEDURE testout (param1 in varchar2, paramout out varchar2) as
    xxx varchar2(30) := '';

    BEGIN
    testglobalvars.init;

    FOR i in 65..75 LOOP
    dbms_output.put_line(xxx || to_char( p_version,'999') ||
    param1 || to_char(testglobalvars.g_version, '999'));
    xxx := xxx || '.';
    testglobalvars.g_version := testglobalvars.g_version - 1;
    p_version := p_version - 1;

    testglobalvars.g_vchar := CHR(i);

    dbms_output.put_line('g_vchar = ' ||testglobalvars.g_vchar);
    dbms_output.put_line('g_vchar = ' || testglobalvars.g_vchar);
    END LOOP;

    paramout := xxx;
    END testout;
    END testglblv_pkg;


    Thanks again,

    John

    Later> Hmmm... Sorry for the lack of indentation. I note that yours got it somehow but not sure how to affect it myself.

    Edited by: jludlow on Nov 1, 2011 10:26 AM
  • 7. Re: tool tip for global vars?
    Gary Graham Expert
    Currently Being Moderated
    Hi John,

    Thanks for providing a reproducible test case. I have logged the following internal bug:
    Bug 13337302 - FORUM: VARIABLE TOOL TIP NOT WORKING FOR GLOBALS OUTSIDE OF PKG BEING DEBUGGED

    There may be more than one way to add formatted text on this forum, but I just paste my text between two lines containing "{code}" without the quotes.

    Cheers,
    Gary
  • 8. Re: tool tip for global vars?
    74641 Newbie
    Currently Being Moderated
    Hi Gary,

    No problem. I haven't posted on a help forum very often for a loooong time. I had sort of forgotten the reproducable test case protocol. Thanks for setting me straight.

    What do you think? Has my question been answered at this point - or do I wait until the bug is fixed to click that? Does it make a difference?

    John
  • 9. Re: tool tip for global vars?
    Gary Graham Expert
    Currently Being Moderated
    Hi John,

    Well, there's no telling when it will get fixed. For example, it very well may not make 3.1 production. The developer who makes the fix might update this thread, or not. If I get an email when it is fixed (I should), then my personal policy is to update the thread if no one else does. So it's really up to you whether or not you wish to mark this as answered at this time.

    Thanks again,
    Gary
  • 10. Re: tool tip for global vars?
    74641 Newbie
    Currently Being Moderated
    Hi Gary,

    Well, that's good intel, I guess. It looks like it doesn't matter one way or the other. It will be fixed at some indeterminate point and saying that it's answered or not won't affect that. I think we've done all we can do until then. Maybe the programmer will update the thread - or maybe not - so there's not point in checking it every week or something. I won't be holding my breath - 1.5 does pretty well for me in this limited application. 3.0.04 is useless to me if I can't read the current value of globals defined in that way. Plus - as I pointed out earlier - I have other tools available. I'll uninstall 3.0.4 and check back in a year or so.

    Thanks again very much for your help!

    John

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points