forums › forums › SQLyog › SQLyog: Bugs / Feature Requests › Results "export As" Table Name Issue
- This topic is empty.
-
AuthorPosts
-
-
June 15, 2011 at 3:43 pm #12359smineParticipant
i use “Export As…” in results (Ctrl+Chift+E) and generate the output as SQL. here is my SQL search query
Code:select * from web_system_variable wsv where wsv.key_name like 'concurrent%'and here is the generated SQL
Code:/*
SQLyog Ultimate v9.10
MySQL – 5.0.45-log
*********************************************************************
*/
/*!40101 SET NAMES utf8 */;insert into `wsv` (`key_name`, `key_value`) values('concurrent…','some_string');
note that the table name here is the alias of the original query. of course, this SQL fails when i try to execute it unless i manually add the table name.
perhaps it has always been like this but i just noticed it today. is this desired behavior?
-
June 15, 2011 at 6:35 pm #32355peterlaursenParticipant
I do not think we can do anything about it. When you use an alias (for tables or columns) I think the server does not return information in the result set about original table and column names. And besides in some cases user would want *this* and sometimes *that*. This particular export option was introduced in SQLyog years back after user requests from users that found this option in phpMyAdmin and liked it (so do you find any difference with the two programs?). The “dump” in such case is created from the internal SQLyog data buffer and teh GRID and does not consider the textual framing of the query.
Not using an alias should work! Anyway, please wait for the final conclusion after we have discussed this and checked some internals.
-
June 15, 2011 at 7:08 pm #32356peterlaursenParticipant
BTW: what behaviour would you expect if your query aggregated columns from different tables (using JOIN or UNION constructs) with or without alias'es?
Actually I am not sure what we do in such case. But the option to 'export as SQL' from RESULT tab is really a 'dirty hack'. SQL basically does not apply to RESULT-data but to 'stored data'. We popup a warning when user is using the option and have it documented in the help file as well. But the 'hack' may still be useful in some scenarios.
-
June 16, 2011 at 5:19 am #32357vishal.prMember
This is confirmed to be a bug since MySQL result structure does avail the original table name under org_table. However this is not possible through HTTP connection as PHP does not expose such information. Same with aliases for column name.
The issue reported here.
http://code.google.com/p/sqlyog/issues/detail?id=1655
We will check this with priority. Thank you for reporting the issue.
Regards,
Vishal P.R
-
June 16, 2011 at 5:49 am #32358vishal.prMember
Just a point to add to my previous post. I think the original table/column name make sense only when you are exporting the result set as SQL. So it can be a user configurable option (a check box for instance) to use original table name that should be grayed out in case of HTTP connection.
-
June 16, 2011 at 7:33 am #32359peterlaursenParticipant
But still: if the result set is JOINed from multiple tables, what then? I am not sure about what do we do now in such case, actually.
-
June 16, 2011 at 10:47 pm #32360smineParticipant
thank you all for the answers. i understand the issue. i'm not sure i have any alternatives, it just seems to me that the table alias name will not work (unless it happens to be identical to the real table name) so isn't too useful.
anyway, thanks!
-
June 17, 2011 at 7:46 am #32361peterlaursenParticipant
We are going to discuss today how we can improve this.
-
-
AuthorPosts
- You must be logged in to reply to this topic.