You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
SQL_DESC_DISPLAY_SIZE Column/Descriptor attribute is used to get the number of symbols needed to display [any] value a particular column will have (in the current result set or in general, depending on context).
For fixed-size data this value is easily calculated/available before knowing all values in the result set.
For variable size types, it can be calculated reliably only after analyzing the entire result set. But not available for general case.
Currently the driver tries to provide a "good enough" display size for variable size types (String type, mainly) by returning the biggest actual value size met so far, during retrieval of the result set. While this is helpful, if the goal is to achieve prettier output in command line utilities like isql, it looks like this doesn't play well with Tableau, which, for reasons unknown (probably a bug), unfairly attaches importance to that property and handles data as if its real size is defined by the reported display size, and not the actual size which is always available together with data.
With the current driver strategy, there could be scenarios where the display size is queried before the driver had a chance to calculate "better" value for a longer data, so that long data will be truncated by Tableau in its further manipulations, resulting in incorrect mappings, etc.
The solution would be (as always) to strictly follow specs from https://docs.microsoft.com/en-us/sql/odbc/reference/appendixes/display-size and report SQL_NO_TOTAL when the display size is not exactly known. A possible bonus would be to adjust that display size for variable size types after the entire result set is fetched. That could be useful in rare cases when application wants to know an accurate display size after it retrieved all the data.
The text was updated successfully, but these errors were encountered:
SQL_DESC_DISPLAY_SIZE
Column/Descriptor attribute is used to get the number of symbols needed to display [any] value a particular column will have (in the current result set or in general, depending on context).For fixed-size data this value is easily calculated/available before knowing all values in the result set.
For variable size types, it can be calculated reliably only after analyzing the entire result set. But not available for general case.
Currently the driver tries to provide a "good enough" display size for variable size types (
String
type, mainly) by returning the biggest actual value size met so far, during retrieval of the result set. While this is helpful, if the goal is to achieve prettier output in command line utilities likeisql
, it looks like this doesn't play well with Tableau, which, for reasons unknown (probably a bug), unfairly attaches importance to that property and handles data as if its real size is defined by the reported display size, and not the actual size which is always available together with data.With the current driver strategy, there could be scenarios where the display size is queried before the driver had a chance to calculate "better" value for a longer data, so that long data will be truncated by Tableau in its further manipulations, resulting in incorrect mappings, etc.
The solution would be (as always) to strictly follow specs from https://docs.microsoft.com/en-us/sql/odbc/reference/appendixes/display-size and report
SQL_NO_TOTAL
when the display size is not exactly known. A possible bonus would be to adjust that display size for variable size types after the entire result set is fetched. That could be useful in rare cases when application wants to know an accurate display size after it retrieved all the data.The text was updated successfully, but these errors were encountered: