14 Replies Latest reply on Feb 19, 2016 8:24 PM by Gary Graham-Oracle

    New Query Result Tab

    Aloupha

      Hello,

       

      I am having a minor issue with my SQL Developer. Although I have the "Show query result in new tab" unchecked from the preference, SQL Dev keeps creating new tab for each query I run. The funny thing is I have SQL Dev on a different computer, and it is not creating new tabs for each result.

       

      It's not behaving correctly on my work laptop with Win 7. It is behaving correctly on my desktop PC with Win 10. I am not sure if the issue is OS related, but that's about the only thing I can think of. Any ideas how I can get SQL Dev to stop generating new Query result tabs for each query I run on the laptop with Win 7?

        • 1. Re: New Query Result Tab
          thatJeffSmith-Oracle

          Sounds like the preferences file is messed up. You might need to restore your preferences to the defaults by deleting your renaming your system directory in the Windows AppData folder for SQL Developer.

          1 person found this helpful
          • 2. Re: New Query Result Tab
            Aloupha

            Thanks, I tried that but it didn't work. It was worth a shot though.

            • 3. Re: New Query Result Tab
              thatJeffSmith-Oracle

              You don't say which version you're running?

              • 4. Re: New Query Result Tab
                Aloupha

                I am using the latest version, 4.1.3.20

                • 5. Re: New Query Result Tab
                  thatJeffSmith-Oracle

                  The best workaround I can offer is to un-pin the grids or close them as you're done with them.

                   

                  Are you sure you deleted the right directory?

                  • 6. Re: New Query Result Tab
                    Aloupha

                    I think I did...

                     

                    These are the directories I deleted.

                     

                    ...\AppData\Roaming\SQL Developer and

                    ...\AppData\Roaming\sqldeveloper


                    That workaround is what I have been doing, and it is very annoying. That's why I am trying to solve this issue.

                    • 7. Re: New Query Result Tab
                      thatJeffSmith-Oracle

                      Yup. So i'm officially stumped.

                      • 8. Re: New Query Result Tab
                        Aloupha

                        Thank you for trying to help

                         

                        Hopefully someone else has some thoughts.

                        • 9. Re: New Query Result Tab
                          Aloupha

                          GRR! Now, my desktop computer just started doing it as well. I am completely lost for words. I have no clue what could be causing this... the common denominator here is me.

                          • 10. Re: New Query Result Tab
                            Gary Graham-Oracle

                            If you are only running one SQL statement at a time with Run Statement (Ctrl+Enter), then I am also stumped.

                             

                            However if you are selecting the text of multiple SQL statements in the worksheet, regardless of the state of the Show query results in new tabs preference, then the results tabs of those statements will always be pinned since there will be more than one result grid and we would not want each successive result to replace the one before it, only leaving the last result.

                             

                            Could that be the scenario you are running?

                            • 11. Re: New Query Result Tab
                              thatJeffSmith-Oracle

                              Nice catch Gary. I totally overlooked that use case/scenario.

                              • 12. Re: New Query Result Tab
                                Aloupha

                                That's not the case, and I, too, would expect multiple Query Result tabs for running multiple queries. But, that's not the case.

                                 

                                Surprisingly, my work laptop is now showing one Query Result tab. I haven't done anything to the settings. I must be doing something that is causing this, but I am stomped as to what that is.

                                 

                                ------

                                 

                                I wrote the above statement and just before hitting the "Add Reply" button, I ran a query just to be sure, and the issue reappeared. This makes absolutely no sense.

                                • 13. Re: Re: New Query Result Tab
                                  Aloupha

                                  I think I am getting a little bit closer to my problem. I was digging more into Gary's line of thinking. It looks like the issue has to do with the query itself, even though it is one SQL statement.

                                   

                                  Check this out... if I run this query, I almost always get multiple tabs (sometimes I don't).

                                   

                                  SELECT

                                            COUNT (*)

                                  FROM

                                            MYDB

                                  WHERE

                                            TYPE IS NULL

                                  AND

                                    (

                                      CLASS   != 'Real Estate' OR CLASS    IS NULL

                                       )

                                  ;

                                   

                                  If I comment out the and clause, and run the Query again, I do not get the multiple tabs. Sometimes I do still get it, but if I comment out the WHERE and AND clauses, I do not get multiple tabs.

                                   

                                  This is really weird.

                                  • 14. Re: New Query Result Tab
                                    Gary Graham-Oracle

                                    In order to help isolate what is going on in your environment, consider the following...

                                    1.  To test multiple instances of user settings (migrated, not migrated,
                                    etc) for a specific SQL Developer release, add something like the
                                    following line to your sqldeveloper.conf file:

                                        AddVMOption -Dide.user.dir=<full path to owning directory of current test version of the system4.1.3.20.78 folder> -- for example, C:/SQLDevUserSetting1


                                     

                                    2. You can verify the value of Show query results in new tabs by checking the product-preferences.xml file.  It defaults to false, and probably has something like...

                                       <hash n="DBConfig">

                                          <value n="AUTOPIN_RESULTS_TABS" v="false"/>

                                     

                                    3.  If you really think it is the query, provide a full test case with DDL
                                    and insert statements with test data, or use a WITH-clause to simulate
                                    test data as in...

                                     

                                    with mydb as (

                                      select 'UpperDivision' as type, 'Math211' as class from dual union all

                                      select 'LowerDivision' as type, 'Math1A' as class from dual union all

                                      select null as type, null as class from dual union all

                                      select null as type, 'First Aid' as class from dual union all

                                      select null as type, 'Real Estate' as class from dual

                                    )

                                    select count(*) from mydb

                                    where type is NULL and (class != 'Real Estate' or class is null);

                                     

                                     

                                    4. I suppose we are all assuming this is for an Oracle connection, but you should elaborate on that.

                                     

                                     

                                    Weird, indeed.

                                     

                                    Best Wishes,

                                    Gary

                                    SQL Developer Team