Unsupported Screen Size: The viewport size is too small for the theme to render properly.

Executing Multiple Sql Statements In The Query Window

forums forums SQLyog Using SQLyog Executing Multiple Sql Statements In The Query Window

  • This topic is empty.
Viewing 5 reply threads
  • Author
    Posts
    • #12339
      Larry Woods
      Member

      I want to execute two SQL SELECT statements in the Query window and see the BOTH results displayed in the Result window. I have tried various “tricks” but can't get multiple SQL statements to execute and display their results.

      Is this possible in SQLyog?

      Thanks

    • #32274
      peterlaursen
      Participant

      Of course it is possibe. Click the 'double arrow icon (or use shortcut Shift+F5) to execute all queries. A RESULT tab will open for each query.

      (maybe you should check the documentation from help .. help menu)

    • #32275
      Larry Woods
      Member
      'peterlaursen' wrote:

      Of course it is possibe. Click the 'double arrow icon (or use shortcut Shift+F5) to execute all queries. A RESULT tab will open for each query.

      (maybe you should check the documentation from help .. help menu)

      Well, I DID check the documentation and I am using the Query window for a LOT of debugging, consequently I have about 30 queries in the window, including DELETEs and INSERTS. The documentation says that Shift-F9 (AND NOT Shift-F5) will execute ALL queries. I read that to mean ALL queries in the window and NOT just the selected queries. If Shift-F5 (Shift-F9) will execute JUST the SELECTED SQL statements then it might be a good idea to say that! So, before I destroy my database, can you tell me (1) is it Shift-F5 or Shift-F9 and (2) will it execute ALL queries or just the SELECTED queries?

      Thanks

    • #32276
      Larry Woods
      Member
      'Larry wrote:

      Well, I DID check the documentation and I am using the Query window for a LOT of debugging, consequently I have about 30 queries in the window, including DELETEs and INSERTS. The documentation says that Shift-F9 (AND NOT Shift-F5) will execute ALL queries. I read that to mean ALL queries in the window and NOT just the selected queries. If Shift-F5 (Shift-F9) will execute JUST the SELECTED SQL statements then it might be a good idea to say that! So, before I destroy my database, can you tell me (1) is it Shift-F5 or Shift-F9 and (2) will it execute ALL queries or just the SELECTED queries?

      Thanks

      While waiting for your answer I connected to a database and entered the following in the Query window:

      SELECT * FROM table1 LIMIT 1;

      SELECT * FROM table2 LIMIT 1

      I tried just hitting Shift-F9 (AND Shift-F5) both with, and without the “;” at the end of the first SELECT statement. I also tried selecting the statements and NOT selecting the statements. The only action that produced any result was the one above (with the “;” at the end of the first SQL statement). By selecting the two SQL statements I got a result of ONE record; the record from table1. I did NOT receive any result from table2!

    • #32277
      Larry Woods
      Member
      'Larry wrote:

      While waiting for your answer I connected to a database and entered the following in the Query window:

      SELECT * FROM table1 LIMIT 1;

      SELECT * FROM table2 LIMIT 1

      I tried just hitting Shift-F9 (AND Shift-F5) both with, and without the “;” at the end of the first SELECT statement. I also tried selecting the statements and NOT selecting the statements. The only action that produced any result was the one above (with the “;” at the end of the first SQL statement). By selecting the two SQL statements I got a result of ONE record; the record from table1. I did NOT receive any result from table2!

      In snooping around I HAVE found the output from the second query under another “Result” tab. So I checked the documentation. Huh! Doesn't tell me that is where I should have found it! Other packages that I have used (MS Enterprise Manager) lists the results in a single “Results” window, which is what I was expecting since I wanted to compare results—which I would image most users would want to do.

    • #32278
      Aparna
      Member
      Quote:
      Is it Shift-F5 or Shift-F9

      This depends on the options in the preferences that reads “Switch F9 and F5 functionality”. If this option is checked then shift+F5 will execute all queries instead of Shift+F9. This option is present in tools menu->preferences->others tab. On opening this you can push F1(which opens the help file) for more details.

      Quote:
      In snooping around I HAVE found the output from the second query under another “Result” tab. So I checked the documentation. Huh! Doesn't tell me that is where I should have found it!

      When you have loaded multiple queries in the editor please push F1 and it is mentioned that “Each query would create a new tab for its resultset in the Result Window”.

      Please see the attached screen shot for the preferences option. Thank you!

Viewing 5 reply threads
  • You must be logged in to reply to this topic.