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

Results "export As" Table Name Issue

forums forums SQLyog SQLyog: Bugs / Feature Requests Results "export As" Table Name Issue

  • This topic is empty.
Viewing 7 reply threads
  • Author
    Posts
    • #12359
      smine
      Participant

      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?

    • #32355
      peterlaursen
      Participant

      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.

    • #32356
      peterlaursen
      Participant

      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.

    • #32357
      vishal.pr
      Member

      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

    • #32358
      vishal.pr
      Member

      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.

    • #32359
      peterlaursen
      Participant

      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.

    • #32360
      smine
      Participant

      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!

    • #32361
      peterlaursen
      Participant

      We are going to discuss today how we can improve this.

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