1 Reply Latest reply on Jun 21, 2016 5:10 AM by lenaic.ridinger

    Why Tableau maps SQL_INTEGER type to unsigned long C type in ODBC driver

    Iryna Tyshko

      Hello,

       

      I faced a problem of Tableau loading INTEGER values as UNSIGNED INT values in ODBC connection.

       

      In SQLGetTypeInfo, I map DB-specific INTEGER data type to SQL data type "SQL_INTEGER", which is defined in sql.h:

      #define SQL_INTEGER  4

      However in SQLBindCol for INT column Tableau passes SQL_C_ULONG (-18) as target type:

      #define SQL_UNSIGNED_OFFSET (-22)

      #define SQL_C_LONG  SQL_INTEGER

      #define SQL_C_ULONG (SQL_C_LONG+SQL_UNSIGNED_OFFSET)

      All negative values are converted in big positives in Tableau.

      As a workaround, I map INT to SQL_BIGINT, which is signed, but it uses twice more memory than necessary.

       

      Could somebody help me figure out how to load 2-byte signed integers to Tableau?

       

      Tableau version: 9.2.4 (9200.16.0204.1543), 64-bit

       

      Thanks in advance,

      Iryna