5 Replies Latest reply on Jul 29, 2020 9:26 AM by Peter2_1

    Wish: Sound / message after long running queries

    Peter2_1

      Maybe I missed an already existing feature, but is there a message or sound or tray message or something else to report the user that a long running query is done?

       

      If not - great idea to implement?

        • 1. Re: Wish: Sound / message after long running queries
          flavioc

          I have been asking for this feature ages ago but with no luck.

          • 2. Re: Wish: Sound / message after long running queries
            Vadim Tropashko-Oracle

            Here is how to hack it to write an extension in 20.2.

             

            Open the following "beep at the end of the query execution.arbori" nashorn script:

             

            include "std.arbori"

             

            runWithBeep: runOnce -> {

               var panel = struct.get('outlinePanel');

               var editor = panel.getEditor()

               var runButton = editor.getToolbar().getComponent(1)

               print(runButton.getToolTipText())

             

               runButton.doClick()

               var t1 = java.lang.System.currentTimeMillis();

              

               new java.lang.Thread(function () {

                  var i = 0;

                  java.lang.Thread.sleep(500)

                  while( runButton.isEnabled() == false ) {

                      print(i++)

                      java.lang.Thread.sleep(500)

                  }

                  var t2 = java.lang.System.currentTimeMillis();

                  print('Elapsed='+(t2-t1))

                  java.awt.Toolkit.getDefaultToolkit().beep();

               }).start()

             

            }  

             

            Basically, we find the right button, press it, and wait for it to become enabled again. And here witness it running:

             

            beep.png

            • 3. Re: Wish: Sound / message after long running queries
              Peter2_1

              Vadim Tropashko-Oracle schrieb:

               

              ...Basically, we find the right button, press it, and wait for it to become enabled again. And here witness it running:

              This seem to be beyond my knowledge ..

               

              I ..

              - ... copied the code and saved it as arbori

              - ... opened it with SQL Dev 19.4

              - ... got no "Run" button in that sheet

              - .. opened a new worksheet and entered a SQL select which takes some seconds to be complete

              - .. started it with Ctrl+Enter and F5 and got results as usuall

              - .. but saw nothing else - no extra window, no beep, no nothing ..

               

              What made I wrong?

              • 4. Re: Wish: Sound / message after long running queries
                Vadim Tropashko-Oracle

                It works in 20.2, but not in 19.4.

                 

                The extra window is java console which appears when you start sqldev from sqldeveloper/bin directory. It is not necessary in this case. You can choose any java API call which action you can witness, I simply have chosen to print onto the console.

                 

                You can keep multiple independent versions of SQL developer at the same machine.

                • 5. Re: Wish: Sound / message after long running queries
                  Peter2_1

                  Now I ..

                  1. updated to 20.2
                  2. opened the arbori-file
                  3. pressed the green "run-button"
                  4. got an error, should open "Code outline"
                  5. opened "code outline"
                  6. pressed the green-button again
                  7. made a SELECT which takes 2 seconds
                  8. pressed both "Ctrl+Enter" and F5
                  9. got expected result, but no beep

                   

                  We can stop this topic here; my first posting was indented as a question or a suggestion for a new option. I just don't need it just now to stay alive - so Vadim Tropashko-Oracle (and me) spent enough time for this small thing