All Forums Tools
dhiraj_dt121 4 posts Joined 07/16
06 Jul 2016
TPT export to delimited files Error

Error : TPT_INFRA: TPT02638: Error: Conflicting data length for column(5) - STATE. Source column's data length (16) Target column's data length (8).

EXPORT_OPERATOR: TPT12108: Output Schema does not match data from SELECT statement

 

Code : 

DEFINE JOB MOVE_DATA_WITHOUT_LANDING_TO_DISK
 
DESCRIPTION 'MOVE DATA WITHOUT LANDING THE DATA TO DISK'
(

   /*** Schema Definition ***/
 
   DEFINE SCHEMA EMPLOYEE_SCHEMA
   DESCRIPTION 'SAMPLE EMPLOYEE SCHEMA'
   (
	BU_ID VARCHAR(100),
RGN_ID VARCHAR(60),
PROD_ID VARCHAR(60),
BU_CD VARCHAR(200),
STATE DECIMAL(22,0),
ISID VARCHAR(2000),
PM_NM VARCHAR(2000),
IS_MRKTNG VARCHAR(50),
IS_MDCL VARCHAR(50),
BU_BDGT_OWNER_ISID VARCHAR(1000),
BDGTITEM_FLAG VARCHAR(10),
UPLD_DT TIMESTAMP(0),
SRC_ID VARCHAR(10)
   );
 
 /*** Export Operator Definition ***/
 
   DEFINE OPERATOR EXPORT_OPERATOR
  DESCRIPTION 'TERADATA PARALLEL TRANSPORTER EXPORT OPERATOR'
   TYPE EXPORT
   SCHEMA EMPLOYEE_SCHEMA
   ATTRIBUTES
   (
      VARCHAR PrivateLogName = '/home/cnbietl/tgt.log',
 
      INTEGER MaxSessions    =  32,
 
      INTEGER MinSessions,
 
      VARCHAR TdpId          = 'TDCPRD01',
 
      VARCHAR UserName       = 'APCNNGBI_MEDEDETL',
 
      VARCHAR UserPassword   = 'TERADATA',
 
      VARCHAR SelectStmt     = 'SELECT * FROM APCNNGBI_MEDED.EVT_BU'
	  
   );
   
   /*** Load Operator Definition ***/
  DEFINE OPERATOR FILE_WRITER
 TYPE DATACONNECTOR CONSUMER
 SCHEMA EMPLOYEE_SCHEMA
 ATTRIBUTES
 (
 VARCHAR PrivateLogName = 'dataconnector_log',
 VARCHAR DirectoryPath = '/home/cnbietl/SYNC',
 VARCHAR FileName = 'test_file.csv',
 VARCHAR Format = 'Delimited',
 VARCHAR OpenMode = 'Write',
 VARCHAR TextDelimiter = ','
 ); 
 
 APPLY
   TO OPERATOR (FILE_WRITER)
    SELECT * FROM OPERATOR (EXPORT_OPERATOR);
 );

The source table schema is same as defined in the job script. I face same error when I try to use the TPT to load this source data to the target table as well in another environment

 

feinholz 1234 posts Joined 05/08
06 Jul 2016

By default, TPT is supporting a DECIMAL precision of 18 (8 bytes).
Since your source column is defined as DECIMAL with a precision of 22 (needing 16 bytes), you need to add the MaxDecimalDigits=31 to the Export operator definition.
The Export operator will then tell the database that it can support Large Decimal columns and the full 16 bytes will be exported, not just 8.
 

--SteveF

dhiraj_dt121 4 posts Joined 07/16
06 Jul 2016

Thanks this works. Now i am faced with another issue when using the unicode character sets for some Columns. All the records are in error tables.

EXPORT_OPERATOR: entering End Export Phase

EXPORT_OPERATOR: Total Rows Exported:  240537

LOAD_OPERATOR: entering Application Phase

LOAD_OPERATOR: Statistics for Target Table:  'APCNNGBI_MEDED.EVT_VISIT_MTNG_ITEM'

LOAD_OPERATOR: Total Rows Sent To RDBMS:      240537

LOAD_OPERATOR: Total Rows Applied:            0

LOAD_OPERATOR: Total Rows in Error Table 1:   240537

LOAD_OPERATOR: Total Rows in Error Table 2:   0

LOAD_OPERATOR: Total Duplicate Rows:          0

 

 

Error code in table : 6706

 

 

 
 

feinholz 1234 posts Joined 05/08
07 Jul 2016

A 6706 is:
"6706 The string contains an untranslatable character."
 
What client session character set are you using in the script?
 

--SteveF

You must sign in to leave a comment.