Forum Stats

  • 3,767,865 Users
  • 2,252,726 Discussions
  • 7,874,367 Comments

Discussions

Add new option on right-click menu: "Expand all"

lead1111
lead1111 Member Posts: 19 Bronze Badge

On SQL Server Developer connection sub-items, having a right-click menu option to expand all would save a lot of clicks.

For example: currently to view all Packages compile status (errors), each package needs to be clicked individually (plus button). Adding a right click menu option called "Expand All" would activate all child "plus buttons" so all package errors could be visible at once with one click.

In the case of huge databases where this may impact performance (1000s of child items?), a warning could popup, or provide a cancel button. I assume this would not apply to the majority of databases.


Chris

Best Answer

  • user9540031
    user9540031 Member Posts: 129 Silver Badge
    Accepted Answer

    Hello,

    Adding a right click menu option called "Expand All" would activate all child "plus buttons"

    Funny you'd like to have a menu entry to expand everything in a single click, whereas personally I constantly use filters to narrow things down to as few child nodes as possible—but that's just me.

    so all package errors could be visible at once with one click

    If what you really want to see is packages (or package bodies) with errors, why would you expand all Tables, Views, Indexes, Sequences, Triggers, Synonyms, Scheduler, you-name-it, at the same time? Sorry, but that sounds terrible!

    If you're dealing with compilation of PL/SQL objects, what about crafting your own custom Report, in order to list packages with errors, along with a link to the corresponding editor?

    For example, just wrap the following query in a Report and you're done—or close: this is just a starting point, of course.

    select a.type
         , a.owner
         , a.name
         , nvl(b.error_cnt, 0) as err#
         , nvl(b.warning_cnt, 0) as warn#
         , 'SQLDEV:LINK:' || a.owner || ':' || a.type || ':' || a.name
                || ':oracle.dbtools.raptor.controls.grid.DefaultDrillLink'  as "LINK (double click)"
         , case
               when b.error_cnt > 0 then 'SQLDEV:GAUGE:0:100:100:100:0' -- Red
               when b.warning_cnt > 0 then 'SQLDEV:GAUGE:0:100:0:100:0' -- Orange
               else 'SQLDEV:GAUGE:0:100:0:0:0' -- Green
           end  as  stat
      from dba_plsql_object_settings a
         , (select owner
                 , name
                 , type
                 , sum(decode(attribute, 'ERROR', 1))    as error_cnt
                 , sum(decode(attribute, 'WARNING', 1))  as warning_cnt
            from dba_errors
           group by owner
                  , name
                  , type
           ) b
     where a.owner = b.owner (+)
       and a.name  = b.name (+)
       and a.type  = b.type (+)
     order by a.owner
            , a.name
            , a.type;
    

    Oh, and how was that Expand All menu entry supposed to work with node filters, BTW?

    My two cents...

    Regards,

Answers

  • user9540031
    user9540031 Member Posts: 129 Silver Badge
    Accepted Answer

    Hello,

    Adding a right click menu option called "Expand All" would activate all child "plus buttons"

    Funny you'd like to have a menu entry to expand everything in a single click, whereas personally I constantly use filters to narrow things down to as few child nodes as possible—but that's just me.

    so all package errors could be visible at once with one click

    If what you really want to see is packages (or package bodies) with errors, why would you expand all Tables, Views, Indexes, Sequences, Triggers, Synonyms, Scheduler, you-name-it, at the same time? Sorry, but that sounds terrible!

    If you're dealing with compilation of PL/SQL objects, what about crafting your own custom Report, in order to list packages with errors, along with a link to the corresponding editor?

    For example, just wrap the following query in a Report and you're done—or close: this is just a starting point, of course.

    select a.type
         , a.owner
         , a.name
         , nvl(b.error_cnt, 0) as err#
         , nvl(b.warning_cnt, 0) as warn#
         , 'SQLDEV:LINK:' || a.owner || ':' || a.type || ':' || a.name
                || ':oracle.dbtools.raptor.controls.grid.DefaultDrillLink'  as "LINK (double click)"
         , case
               when b.error_cnt > 0 then 'SQLDEV:GAUGE:0:100:100:100:0' -- Red
               when b.warning_cnt > 0 then 'SQLDEV:GAUGE:0:100:0:100:0' -- Orange
               else 'SQLDEV:GAUGE:0:100:0:0:0' -- Green
           end  as  stat
      from dba_plsql_object_settings a
         , (select owner
                 , name
                 , type
                 , sum(decode(attribute, 'ERROR', 1))    as error_cnt
                 , sum(decode(attribute, 'WARNING', 1))  as warning_cnt
            from dba_errors
           group by owner
                  , name
                  , type
           ) b
     where a.owner = b.owner (+)
       and a.name  = b.name (+)
       and a.type  = b.type (+)
     order by a.owner
            , a.name
            , a.type;
    

    Oh, and how was that Expand All menu entry supposed to work with node filters, BTW?

    My two cents...

    Regards,

  • lead1111
    lead1111 Member Posts: 19 Bronze Badge

    Thanks. I saw custom reports, so that may be an option. I'll look into that.

    Also, I've never used node filtering so I'll check that out also.

    why would you expand all Tables, Views, Indexes, Sequences, Triggers, Synonyms, Scheduler, you-name-it

    I was thinking the Expand All option could apply (maybe only apply) to child nodes in the tree. You're right, expanding everything at a high level node seems like a waste of resources and could be time consuming.

    Have a good one.

  • lead1111
    lead1111 Member Posts: 19 Bronze Badge

    Hey user9540031,

    Just added that report. Nice. I'll be using this as a template.

    Thanks.