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

How To Export Empty String Instead Of (Null) From Grid

forums forums SQLyog SQLyog: Bugs / Feature Requests How To Export Empty String Instead Of (Null) From Grid

  • This topic is empty.
Viewing 4 reply threads
  • Author
    Posts
    • #12119
      Joe Petronio
      Member

      I'm trying to export the results of a query to the clipboard, and then paste it into Excel. The only problem I'm having is NULL values are either exported as “(NULL)” or “N”. I would prefer an empty string or nothing at all. Is there a simple way to do this ? I'm using MySQL 5.1 and SQLYog 8.6GA.

      Thanks !

    • #31382
      Aparna
      Member

      Hi Joe,

      Well as i understand although you have “NULL” in the grid data you want it to be exported as “EMPTY” string. Well this is not possible as “NULL” and “EMPTY STRING” are completely 2 different things. If the data in the Grid is blank then it can be exported as empty string or the other option would be to Find “n” and Replace it with “EMPTY STRING” in the Excel Application. We don't plan to implement this. Please feel free to pour in your suggestions.

      Regards,

      Aparna

    • #31383
      Joe Petronio
      Member

      Hi Aparna,

      Thanks for the quick reply. I've used other popular DB tools, e.g. DBVisualizer, Navicat, Oracle SQL Developer, etc, which export nothing by default, or in some cases allow the user to configure what should be exported in the case of a NULL value.

      Personally, I think the default should be nothing.

      Regards,

      Joe Petronio

    • #31384
      peterlaursen
      Participant

      We have a related request in our issue tracker – please refer http://code.google.com/p/sqlyog/issues/detail?id=1164

      MySQL uses the string 'N' to represent NULL with SELECT INTO OUTFILE and LOAD DATA statements.  That is the reason why also SQLyog does.  But in case the exported file shall not be used with MySQL but another program (a spreadsheet for instance) both 'NULL' and '' (empty string would be useful – depending on the context where the file shall be used.

    • #31385
      lewisaudio
      Member

      I agree, an option to replace a NULL value with an empty string when exporting results would be a great convenience. A workaround I use when creating a query to be used in a report is:

      SELECT IFNULL(FieldName, '') AS FieldName FROM SchemaName.TableName;

      The IFNULL function will replace any NULL values in the first parameter with the value in the second parameter. In this case the two single quotes returns an empty string.

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