7 Replies Latest reply: Feb 8, 2013 2:04 PM by Hugo Sheng RSS

    Teradata Error in SQL Query Artifact

    Jamie Hicks

      Received this error when running a dataflow using SQL Query Input against teradata:

       

      Exception 'SQLSTATE:[22001], Code:[-3996], Msg:[QVExpressor][ODBC Teradata Client driver][Teradata]Right truncation of string data.

      ' occurred in the 'process' function for thread 0.

       

      The SQL query runs just fine in Teradata SQL Assistant. Any idea what would cause this response?

        • Re: Teradata Error in SQL Query Artifact
          Hugo Sheng

          Do you have a semantic type defined for your string fields?  Could be that one of them is truncating the source data because of the way it was defined.

            • Re: Teradata Error in SQL Query Artifact
              Jamie Hicks

              I looked at the schema. There is only one string field. It is coming over from teradata as a VARCHAR(58) and the Semantic Type for that field is set up as a string with no constraints. Someone suggested that it may be Teradata to ANSI translation issue. They ran into a similar issue when running a Teradata function using ANSI mode. I am using the Expressor teradata connection - not the named ODBC DSN on my box. Is there a way to control the mode of the connection, or should I bypass the Expressor connection and just use ODBC?

                • Re: Teradata Error in SQL Query Artifact
                  Hugo Sheng

                  Are you using a SQL Query operator to retrieve the records from Teradata?   If so, could you try using Read Table instead to see if there's any difference?   A simple dataflow with Read Table -> Trash would do.  In the schema for Read Table, if you only want to keep a subset of the records, you can delete the ones you don't want on the semantic type side (in the schema editor) and that will prevent those columns from being moved downstream.

                   

                  Also, if you were to look at the table definition / table create statement for that table in Teradata, do you see anything unusual?   Different character encoding?

                   

                  As for the ODBC driver, the Expressor supplied one should work just fine - it's a Data Direct driver.