Bug #7352 ResultSets for Scripts
Submitted: 16 Dec 2004 14:46 Modified: 10 Mar 2009 10:52
Reporter: Olivier Armand Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Query Browser Severity:S4 (Feature request)
Version:1.1.3, 1.2.12 OS:Windows (Windows XP SP1 Professional)
Assigned to: CPU Architecture:Any

[16 Dec 2004 14:46] Olivier Armand
Description:
I need to execute queries using user variables, but according to other bug reports variables can only be used in scripts (to execute the query in a single connection).

Unfortunately when executing scripts from a script window, no ResultSet tab is created to see the results of SELECT statements...

How to repeat:
-
[16 Dec 2004 15:52] Michael G. Zinner
Could you give an example how you need to use the server variables?

Does starting a transaction would be a workaround for your task? Or do you need transaction handling in your script?

Thanks a lot.
[16 Dec 2004 17:40] Olivier Armand
For example a query would look like this:

SET @min_date='2004-01-12';
SET @max_date='2004-12-31';

SELECT some, fields FROM some, tables
 WHERE some
  AND conditions
  AND date >= @min_date AND date <= @max_date;
  
Of course the values could be hard-coded in the request, but I have a lot of scripts that already exists and can be configured easily with this syntax, and I would like to run them from Query Browser.

When running the requests in the Query Edit bar, I get the error:
<<You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ';
SET @max_date='2004-12-31'' at line 1>>
because multiple requests cannot be run from the Query Edit.

And when running the script from a script window, the query is executed but the result cannot be viewed.
[16 May 2007 15:10] Scott Noyes
I second this request. As of 1.2.12, Query Browser offers no way to execute multiple queries in a single connection and get a result set, without writing a stored procedure. That means no setting of user variables, and no selecting from temporary tables.
[27 Sep 2007 4:59] Valeriy Kravchuk
Thank you for a reasonable feature request.
[29 Sep 2007 19:20] Valeriy Kravchuk
Bug #8302 is a duplicate of this one.
[10 Mar 2009 10:52] Susanne Ebrecht
Thank you for your bug report. This issue has already been fixed in the latest released version of that product, which you can download at

  http://www.mysql.com/downloads/