forums › forums › SQLyog › SQLyog: Bugs / Feature Requests › How To Export Empty String Instead Of (Null) From Grid
- This topic is empty.
-
AuthorPosts
-
-
September 30, 2010 at 6:32 pm #12119Joe PetronioMember
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 !
-
October 1, 2010 at 5:55 am #31382AparnaMember
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
-
October 1, 2010 at 6:12 pm #31383Joe PetronioMember
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
-
October 1, 2010 at 6:22 pm #31384peterlaursenParticipant
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.
-
October 28, 2010 at 7:06 pm #31385lewisaudioMember
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.
-
-
AuthorPosts
- You must be logged in to reply to this topic.