Problem ODBC OPERATOR

Tools & Utilities
Teradata Employee

Problem ODBC OPERATOR

Hi,

I'm loading tables to teradata from sql server 2005 with tpt (odbc-load operator), when I execute the tpt's all the records loaded into an error table (_ET) , the errorcode i got is : 2673 it means "The source parcel length does not match data that was defined." , it is happening for most of the tpt's scripts, so I think I´m doing somethig wrong

Don´t understand why I´m getting this error, for me all is correct !

this is my structure table in sql:
TABLE_SCHEMA TABLE_NAME COLUMN_NAME ORDINAL_POSITION IS_NULLABLE DATA_TYPE CHARACTER_MAXIMUM_LENGTH NUMERIC_PRECISION NUMERIC_PRECISION_RADIX
dbo AA PCC 2 YES nvarchar 255
dbo AA IATA 1 YES float 53 10
dbo AA GDS 3 YES nvarchar 255

this is my tpt:
DEFINE JOB Export_SQL_LOAD_TD (
DEFINE SCHEMA AA_Schema (
IATA CHAR(30)
,PCC CHAR(255)
,GDS CHAR(255)
);
DEFINE OPERATOR DDL_OPERATOR
TYPE DDL
ATTRIBUTES (
VARCHAR UserName = @UseridTrg,
VARCHAR PrivateLogName = 'ddl_log',
VARCHAR UserPassword = @PwdTrg,
VARCHAR TdpId = @TdpidTrg,
VARCHAR ErrorList = '3807' );
DEFINE OPERATOR LOAD_OPERATOR
DESCRIPTION 'TERADATA WAREHOUSE BUILDER LOAD OPERATOR'
TYPE LOAD
SCHEMA AA_Schema
ATTRIBUTES (
VARCHAR TdpId = @TdpidTrg ,
VARCHAR UserName = @UseridTrg ,
VARCHAR UserPassword = @PwdTrg ,
VARCHAR TargetTable = @DB_STG||'.AA',
VARCHAR LogTable = @DB_STG||'.AA_LG',
VARCHAR ErrorTable1 = @DB_STG||'.AA_ET',
VARCHAR ErrorTable2 = @DB_STG||'.AA_UV' );
DEFINE OPERATOR ODBC_Operator
DESCRIPTION 'Teradata Parallel Transporter ODBC Operator'
TYPE ODBC
SCHEMA AA_Schema
ATTRIBUTES (
VARCHAR UserName = @UseridSrc,
VARCHAR DSNName =@TdpidSrc,
VARCHAR PrivateLogName = 'odbc_log',
VARCHAR TruncateData= 'YES',
VARCHAR UserPassword = @PwdSrc,
VARCHAR SelectStmt = 'Select
IATA
,PCC
,GDS
from AA ; ' );
STEP Setup_Tables ( APPLY
('DROP TABLE '||@DB_STG||'.AA ;'),
('DROP TABLE '||@DB_STG||'.AA_UV;'),
('DROP TABLE '||@DB_STG||'.AA_ET;'),
('CREATE TABLE '||@DB_STG||'.AA (
IATA VARCHAR(50)
,PCC VARCHAR(5000)
,GDS VARCHAR(255)
);' ) TO OPERATOR (DDL_OPERATOR); );

STEP Load_Trans_Table ( APPLY
('INSERT INTO DD_STG_CORPORATIVOWEB.AA (
IATA
,PCC
,GDS
) VALUES (
:IATA
,:PCC
,:GDS
);' )
TO OPERATOR (LOAD_OPERATOR[2])
SELECT
IATA
, PCC
, ( GDS)
FROM OPERATOR(ODBC_Operator[1]);
);
);
2 REPLIES
Teradata Employee

Re: Problem ODBC OPERATOR

Your schema does not look like it is matching the data being returned from SQLServer.
The schema from the source table has to VARCHARs and a FLOAT.
But your script schema has 3 CHARs.
Your script schema should match the format of the data as it is being returned by the driver.
If you want, just for an experiment, try to CAST the IATA column to CHAR(30) and see if that helps.

Also, if "nvarchar" in SQLServer syntax corresponds to a Teradata VARCHAR, then your script schema should have VARCHAR for the "nvarchar" columns from the source table.
-- SteveF
Teradata Employee

Re: Problem ODBC OPERATOR

thanks!! it works