Virtualtable and empty string-fields
Virtualtable and empty string-fields
Hi, I use VirtualTables to export from and import into SQL-Tables. Now I've the problem that after importing empty stringfields (value = '') are no longer empty but . Is there any option to avoid this?
To reproduce create a VirtualTable, add 2 string-fields, add a record with one field set to null and the second to an empty string, save it to file, reload it from file and check the contents of the fields: both are set do null.
best regards
Toni Santa
To reproduce create a VirtualTable, add 2 string-fields, add a record with one field set to null and the second to an empty string, save it to file, reload it from file and check the contents of the fields: both are set do null.
best regards
Toni Santa
Re: Virtualtable and empty string-fields
Maybe you need change a little table field definitions:tonisanta wrote:Hi, I use VirtualTables to export from and import into SQL-Tables. Now I've the problem that after importing empty stringfields (value = '') are no longer empty but . Is there any option to avoid this?
To reproduce create a VirtualTable, add 2 string-fields, add a record with one field set to null and the second to an empty string, save it to file, reload it from file and check the contents of the fields: both are set do null.
best regards
Toni Santa
CREATE TABLE MyTable (
stringfield varchar(100) NOT NULL DEFAULT ''
)
Hi, with SaveToXML the "NULL - EMTPY STRING" - problem seems to be gone, but DateTime-fields with large precision (milliseconds) are truncated. But this is not a huge problem. The generated XML-Files are approximately 30% larger as "saveToFile"-files. Will there be a fix in future releases to export/import empty strings as such without "converting" them to NULL?
best regards, Toni
best regards, Toni
Your are the developers and therefore the decision is yours. From my point of view nulls and empty strings are not the same and so a sequence of SaveToFile and LoadFromFile should retain the original values of the fields. For currencyfields this seems to work fine, null remains null and 0 remains 0. Could be you provide an optional parameter 'ConvertEmptyStringsToNull' when saving to/loading from file?
with regards, Toni
with regards, Toni