5 Replies Latest reply on Aug 22, 2016 10:53 AM by Jeff Borton

    Tableau is wrapping column with CHAR() which is causing an issue

    Jeff Borton

      I have a DB2 table that is defined as follows:

       

      CREATE TABLE ATTASK.PROJECTS  (

        X                           CHARACTER(32) NOT NULL,

        Y                         VARCHAR(1024),

        Z                         LONG VARCHAR

      )

       

      Tableau creates the following select to retrieve the data:

       

      SELECT "TABLE_A"."X" AS "X",

        "TABLE_A"."Y" AS "Y",

        CHAR("TABLE_A"."Z") AS "Z",

       

      FROM "SCHEME_A"."TABLE_A" "TABLE_A"

      FETCH FIRST 1000 ROWS ONLY

       

      when run it gets the following error:

       

      [IBM][CLI Driver][DB2/AIX64] SQL0433N Value "Currently there are no Integration, Staging, or Load regions" is too long. SQLSTATE=22001

       

      I need to stop the CHAR() wrapper in the default query.

      custom query doesn't work as the CHAR() is still present in the wrapper query.

      my custom query I wrote is

       

      select Z from TABLE_A

       

      which gets converted into

       

      SELECT CHAR("Custom SQL Query"."Z") AS "Z",

        1 AS "Number of Records"

      FROM (

        select Z from SCHEME_A.TABLE_A

      ) "Custom SQL Query"

      FETCH FIRST 1000 ROWS ONLY

       

      How do I override the wrapper/default query?