Teradata TPT error

Tools
Enthusiast

Teradata TPT error

Below query is throwing

TPT12108: Output Schema does not match data from SELECT statement

can some body help me in this

DEFINE JOB DBtoFile

/* 4 */ (

/* 5 */ DEFINE OPERATOR W_1_o_DBtoFile

/* 6 */ TYPE DATACONNECTOR CONSUMER

/* 7 */ SCHEMA *

/* 8 */ ATTRIBUTES

/* 9 */ (

/* 10 */ VARCHAR FileName,

/* 11 */ VARCHAR Format,

/* 12 */ VARCHAR OpenMode,

/* 13 */ INTEGER BlockSize,

/* 14 */ INTEGER BufferSize,

/* 15 */ INTEGER RetentionPeriod,

/* 16 */ INTEGER RowsPerInstance,

/* 17 */ INTEGER SecondarySpace,

/* 18 */ INTEGER UnitCount,

/* 19 */ INTEGER VigilElapsedTime,

/* 20 */ INTEGER VigilWaitTime,

/* 21 */ INTEGER VolumeCount,

/* 22 */ VARCHAR AccessModuleName,

/* 23 */ VARCHAR AccessModuleInitStr,

/* 24 */ VARCHAR DirectoryPath,

/* 25 */ VARCHAR ExpirationDate,

/* 26 */ VARCHAR IndicatorMode,

/* 27 */ VARCHAR PrimarySpace,

/* 28 */ VARCHAR PrivateLogName,

/* 29 */ VARCHAR RecordFormat,

/* 30 */ VARCHAR RecordLength,

/* 31 */ VARCHAR SpaceUnit,

/* 32 */ VARCHAR TextDelimiter,

/* 33 */ VARCHAR VigilNoticeFileName,

/* 34 */ VARCHAR VigilStartTime,

/* 35 */ VARCHAR VigilStopTime,

/* 36 */ VARCHAR VolSerNumber,

/* 37 */ VARCHAR UnitType

/* 38 */ );

/* 39 */

/* 40 */ DEFINE SCHEMA W_0_s_DBtoFile

/* 41 */ (

/* 42 */ empid CHARACTER(6),

/* 43 */ ts_wit_zone CHARACTER(32)

/* 44 */ );

/* 45 */

/* 46 */ DEFINE OPERATOR W_0_o_DBtoFile

/* 47 */ TYPE EXPORT

/* 48 */ SCHEMA W_0_s_DBtoFile

/* 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_DBtoFile[1]

/* 77 */

/* 78 */ ATTRIBUTES

/* 79 */ (

/* 80 */ FileName = 'C:\Documents and Settings\371286\Desktop\DNB\Test\Timestamp1',

/* 81 */ Format = 'TEXT',

/* 82 */ OpenMode = 'Write',

/* 83 */ IndicatorMode = 'N',

/* 84 */ TextDelimiter = ','

/* 85 */ )

/* 86 */ )

/* 87 */ SELECT * FROM OPERATOR

/* 88 */ (

/* 89 */ W_0_o_DBtoFile[2]

/* 90 */

/* 91 */ ATTRIBUTES

/* 92 */ (

/* 93 */ UserName = 'tduser',

/* 94 */ UserPassword = 'tduser',

/* 95 */ SelectStmt = 'SELECT cast(empid as varchar(6)),cast(ts_wit_zone as char(21)) FROM Samples.table_timezone2;',

/* 96 */ TdpId = '172.20.53.85'

/* 97 */ )

/* 98 */ );

/* 99 */ );

Tags (2)
2 REPLIES
Enthusiast

Re: Teradata TPT error

empid is integer and ts_wit_zone is a TSTZ datatype

Enthusiast

Re: Teradata TPT error

This error occures when there is a mismatch between the data types of fields in the Schema definition and the select statement. You need to cast the mismatching columns in the select. Look into the query carefully and then use cast!

Khurram