TPT Wizard datatype casting

Tools & Utilities
Enthusiast

TPT Wizard datatype casting

Since I am new to teradata my DBA suggested to use TPT Wizard to export data from a teradata table to a flat file in | delimited format.

However I noticed that all columns needed to be varchar for this export using TPT. Even though I changed the TPT Type to varchar I am getting below error,

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

Here is the script it generated,

/* 1 */  

/* 2 */  

/* 3 */  DEFINE JOB Test_Cast

/* 4 */  DESCRIPTION 'Test_Cast'

/* 5 */  (

/* 6 */   DEFINE OPERATOR W_1_o_Test_Cast

/* 7 */   TYPE DATACONNECTOR CONSUMER

/* 8 */   SCHEMA *

/* 9 */   ATTRIBUTES

/* 10 */   (

/* 11 */   VARCHAR FileName, 

/* 12 */   VARCHAR Format, 

/* 13 */   VARCHAR OpenMode, 

/* 14 */   INTEGER BlockSize, 

/* 15 */   INTEGER BufferSize, 

/* 16 */   INTEGER RetentionPeriod, 

/* 17 */   INTEGER RowsPerInstance, 

/* 18 */   INTEGER SecondarySpace, 

/* 19 */   INTEGER UnitCount, 

/* 20 */   INTEGER VigilElapsedTime, 

/* 21 */   INTEGER VigilWaitTime, 

/* 22 */   INTEGER VolumeCount, 

/* 23 */   VARCHAR AccessModuleName, 

/* 24 */   VARCHAR AccessModuleInitStr, 

/* 25 */   VARCHAR DirectoryPath, 

/* 26 */   VARCHAR ExpirationDate, 

/* 27 */   VARCHAR IndicatorMode, 

/* 28 */   VARCHAR PrimarySpace, 

/* 29 */   VARCHAR PrivateLogName, 

/* 30 */   VARCHAR RecordFormat, 

/* 31 */   VARCHAR RecordLength, 

/* 32 */   VARCHAR SpaceUnit, 

/* 33 */   VARCHAR TextDelimiter, 

/* 34 */   VARCHAR VigilNoticeFileName, 

/* 35 */   VARCHAR VigilStartTime, 

/* 36 */   VARCHAR VigilStopTime, 

/* 37 */   VARCHAR VolSerNumber, 

/* 38 */   VARCHAR UnitType

/* 39 */   );

/* 40 */  

/* 41 */   DEFINE SCHEMA W_0_s_Test_Cast

/* 42 */   (

/* 43 */   REC_ADD_TS VARCHAR(26)

/* 44 */   );

/* 45 */  

/* 46 */   DEFINE OPERATOR W_0_o_Test_Cast

/* 47 */   TYPE EXPORT

/* 48 */   SCHEMA W_0_s_Test_Cast

/* 49 */   ATTRIBUTES

/* 50 */   (

/* 51 */   VARCHAR UserName, 

/* 52 */   VARCHAR UserPassword, 

/* 53 */   VARCHAR SelectStmt, 

/* 54 */   INTEGER BlockSize, 

/* 55 */   INTEGER MaxSessions, 

/* 56 */   INTEGER MinSessions, 

/* 57 */   INTEGER TenacityHours, 

/* 58 */   INTEGER TenacitySleep, 

/* 59 */   INTEGER MaxDecimalDigits, 

/* 60 */   VARCHAR AccountID, 

/* 61 */   VARCHAR DateForm, 

/* 62 */   VARCHAR NotifyExit, 

/* 63 */   VARCHAR NotifyExitIsDLL, 

/* 64 */   VARCHAR NotifyLevel, 

/* 65 */   VARCHAR NotifyMethod, 

/* 66 */   VARCHAR NotifyString, 

/* 67 */   VARCHAR PrivateLogName, 

/* 68 */   VARCHAR TdpId, 

/* 69 */   VARCHAR TraceLevel, 

/* 70 */   VARCHAR WorkingDatabase

/* 71 */   );

/* 72 */  

/* 73 */   APPLY

/* 74 */   TO OPERATOR

/* 75 */   (

/* 76 */   W_1_o_Test_Cast[1]

/* 77 */  

/* 78 */   ATTRIBUTES

/* 79 */   (

/* 80 */   FileName = 'C:\Documents and Settings\****\Desktop\Test\cast.txt', 

/* 81 */   Format = 'DELIMITED', 

/* 82 */   OpenMode = 'Write', 

/* 83 */   IndicatorMode = 'N', 

/* 84 */   TextDelimiter = '|'

/* 85 */   )

/* 86 */   )

/* 87 */   SELECT * FROM OPERATOR

/* 88 */   (

/* 89 */   W_0_o_Test_Cast[1]

/* 90 */  

/* 91 */   ATTRIBUTES

/* 92 */   (

/* 93 */   UserName = '****', 

/* 94 */   UserPassword = '****', 

/* 95 */   SelectStmt = 'SELECT REC_ADD_TS FROM TEST.Table;', 

/* 96 */   TdpId = 'Server'

/* 97 */   )

/* 98 */   );

/* 99 */  );


Any suggestions?

Tags (2)
2 REPLIES
Highlighted
Enthusiast

Re: TPT Wizard datatype casting

SelectStmt = 'SELECT REC_ADD_TS(VARCHAR(26)) FROM TEST.Table;', 

Enthusiast

Re: TPT Wizard datatype casting

Thank you Jinesh..

That worked..