distal-attribute
distal-attribute
distal-attribute
distal-attribute

Names of Tab from SQL Queries

User, date Message
Written by DB Phantom
2 years ago
Category: Feature discussion
5 posts since Thu, 05 Apr 12
Currently the name of the tabs for a SQL query is the name of the table.

I will run 3 - 7 queries all using the same base table for searching. The results is I get multple tabs with the same name on the tab.

Is there a way to have the tabs named something a little more useful?
Written by ansgar
2 years ago
4962 posts since Fri, 07 Apr 06
The tab caption is set automatically, by analyzing the query. I could add a postfix so they are unique, e.g. "mytable #1", "mytable #2" etc. But is that what you mean by "more useful"?
Written by DB Phantom
2 years ago
5 posts since Thu, 05 Apr 12
My queries are slightly different. For instance, I need to run 3 queries against the Users DB for 3 very different reasons. Seeing Users 3 times isn't useful.

Seeing something other than the table to let me know what it is, is more useful.
Password Check, URL with Email, Banned

Just examples.
Written by ansgar
2 years ago
4962 posts since Fri, 07 Apr 06
Well, "Password Check" or "URL with Email" is nothing I can name automatically, as you might imagine. That's why I asked if "mytable #x" is more useful for you.
Written by DB Phantom
2 years ago
5 posts since Thu, 05 Apr 12
That's better than thesame name over and over again. :)
Written by Ash501
2 years ago
21 posts since Tue, 20 Mar 12
Perhaps the name of the snippet that it's saved into, or the query file you save it into would be more user friendly.....
Written by Ash501
2 years ago
21 posts since Tue, 20 Mar 12
any other query and your on your own....smile
Written by Ash501
2 years ago
21 posts since Tue, 20 Mar 12
Don't get what you mean, DB Phantom:

"Currently the name of the tabs for a SQL query is the name of the table"

It just shows query#1 result#1 etc... by me!?

i'm messing something?
Written by DB Phantom
2 years ago
5 posts since Thu, 05 Apr 12
I will run several quries at one time. Therefore I will get the table name for the SELECT as the tab name. So if I run several that users is the main table from the SELECT (not counting JOIN tables) I will have several tabs called users.
Written by ansgar
2 years ago
4962 posts since Fri, 07 Apr 06
r4127 adds a " #2", " #3" etc. postfixes to identical tab captions.
Written by Ash501
2 years ago
21 posts since Tue, 20 Mar 12
what happens if you have multiple queries for same table? we're back to same problem, no?

seems the name of snippet/or saved query, would be far more user friendly....clear and adjustable to more scenarios.

my 2 cents anyway...
Written by ansgar
2 years ago
4962 posts since Fri, 07 Apr 06
> what happens if you have multiple queries for same table?

Please read my above comment - I added the #2, #3 ... postfix for exactly that situation.

The name of the snippet or saved query would not help, as that is the same for all results, isn't it? You do not execute different snippets for each result grids. By the way, we're not talking about query tabs - what DB Phantom means is the tab captions of the result grids in one query tab. One query tab can have multiple result grids, one grid per result, e.g. if you exceute such queries at once:

SELECT * FROM table1;
SELECT * FROM table2;

Written by DB Phantom
2 years ago
5 posts since Thu, 05 Apr 12
OK- just got the nightly build and tried it out. This will work thanks. :)
Written by Ash501
2 years ago
21 posts since Tue, 20 Mar 12
Just wondering if this is a good idea...
How about using the commenting text for example:

/* Report A */
SELECT * FROM table1;
/* Report B */
SELECT * FROM table1;

Now each result tab could be named: Report A, Report B.
Written by ansgar
2 years ago
4962 posts since Fri, 07 Apr 06
You would have to write a comment just to have the tab named after it. Isn't that manual work for the user for a minimal effect?
Written by Antnee
1 year ago
9 posts since Thu, 21 Jul 11
Hi. I would actually be very interested in being able to set custom names for these tabs somehow. I have a report that I run that is an SQL file with multiple queries, and it comes up as "Result #1", "Result #2" etc. I do have comments in my SQL so that someone reading it (maintaining etc) knows what each query is doing. It would be nice if we could so something like JavaDoc or PHPDoc where we could put something like this:

/**
* Monthly Sales Query
*
* @label Monthly Sales
*/
SELECT sum(*) AS total
, month(sell_date) AS month
FROM sales
GROUP BY month;

/**
* Yearly Sales Query
*
* @label Yearly Sales
*/
SELECT sum(*) AS total
, year(sell_date) AS year
FROM sales
GROUP BY year;



Please don't use my queries as example of good SQlwinkJust indicating how the doc blocks could be used. It would genuinely be useful to me, and I'm sure others too
Written by Antnee
1 year ago
9 posts since Thu, 21 Jul 11
Wow, just spotted so many things wrong with those example queries :D
Written by kalvaro
1 year ago
591 posts since Thu, 29 Nov 07
This is a 9 month old thread. HeidiSQL is basically an administration tool and one of its key points is simplicity. (If you want to get lost in your MySQL client you already have Toad for MySQL.)

IMHO, creating a annotation syntax with its corresponding documentation, parser and use cases goes far beyond the abilities that are reasonable to expect from such a tool. I can't think of any other usage apart from running reports and if we want HeidiSQL to be a decent reporting tool it'll lack tons of other basic features.

If you need to run those reports regularly you should invest a few hours writing an application, possibly a PHP-driven web site or even an Excel spreadsheet.
Written by kalvaro
1 year ago
591 posts since Thu, 29 Nov 07
P.S. To be honest, my experience with TOAD is only with their good old Oracle version. It's possible that their MySQL release has a better usability.
Written by Antnee
1 year ago
9 posts since Thu, 21 Jul 11
OK, firstly, the age of the thread does not change the fact that this is a feature that I've wanted for a while. Adding a tiny little bit of processing such as this also doesn't add any complexity to the application, if you're perfectly honest. It certainly won't require massive documentation, will it? Also, why would I want to write an application or framework to get data out, when Heidi already does it brilliantly? Quickly knock up a query, export data as CSV (or whatever is required), save the SQL file for later use, done.

Heidi is an excellent tool that I've been using for donkeys, but there's no single feature that makes it a killer app, but rather a collection of MANY small features that just makes it indispensable, IMHO. Being able to label the tabs in a multi-query is just another small feature that I'd love to have. It's hardly a deal-breaker, but it would make it much simpler to read the results. The alternative for me is to have the results contain a field that describes what I'm looking at (so making the beginning of the query SELECT 'YEARLY') for example. That sucks.
 

Please login to leave a reply, or register at first.