Facing TPT error while lading data from flat file to Teradata

Tools & Utilities
Enthusiast

Facing TPT error while lading data from flat file to Teradata

Hi,

Below is my TPT script to load data from flat file to Teradata 15.00.

DEFINE JOB LOAD_TPT_TEST2

DESCRIPTION 'LOAD A TERADATA TABLE FROM A FLAT FILE'

(

DEFINE SCHEMA FILESCHEMA

(

EID  INTEGER,

EMPNM VARCHAR(10)

);

DEFINE OPERATOR DATACONN_C2

TYPE DATACONNECTOR PRODUCER

SCHEMA FILESCHEMA

ATTRIBUTES

(

VARCHAR PrivateLogName     = 'STG_DB.TPT_TEST.log',

VARCHAR DirectoryPath      ='/home/richa/',

VARCHAR FileName           = 'testtpt.txt',

VARCHAR Format             = 'Delimited',

VARCHAR TextDelimiter      = ',',

VARCHAR OpenMode        = 'read',

);

DEFINE OPERATOR INSERT_TPT_TEST2

TYPE INSERTER

SCHEMA *

ATTRIBUTES

(

           VARCHAR PrivateLogName   = 'STG_DB.TEST_Space.log',

           VARCHAR TdpId           = '127.0.0.1',

           VARCHAR UserName        = 'dbc',

           VARCHAR UserPassword    = 'dbc',

           VARCHAR TargetTable      = 'RETAIL.TARGET_EMP_TABLE',

           VARCHAR LogTable        = 'retail.STG_DB.TPT_TEST_L',

           VARCHAR ErrorTable1       = 'retail.STG_DB.TPT_TEST_E1',

           VARCHAR ErrorTable2       = 'retail.STG_DB.TPT_TEST_E2',

           VARCHAR WorkTable        = 'retail.STG_DB.TPT_TEST_WT'

);

 APPLY

('INSERT INTO RETAIL.TARGET_EMP_TABLE(:EID,:EMPNM);')

TO OPERATOR (INSERT_TPT_TEST2[])

SELECT

EID,

EMPNM

FROM OPERATOR

  (DATACONN_C2[]);

);

Below error I am facing:

Teradata Parallel Transporter Version 15.00.00.00

TPT_INFRA: Syntax error at or near line 21 of Job Script File 'tptscrff.tp':

TPT_INFRA: At ")" missing { ARRAY_ BIGINT_ BYTEINT_ CHARACTER_ CHAR_ CHARACTERS_                                                                              CHARS_ INT_ INTEGER_ LONG_ SMALLINT_ VARCHAR_ VARDATE_ REGULAR_IDENTIFIER_ EXTE                                                                             NDED_IDENTIFIER_ EXTENDED_IDENTIFIER_NO_N_ } in Rule: Attribute Definition

Compilation failed due to errors. Execution Plan was not generated.

Job script compilation failed.

Job terminated with status 8

 

 

 

 

 

 

 

 

 

 

3 REPLIES
Enthusiast

Re: Facing TPT error while lading data from flat file to Teradata

I think the error may be the trailing comma in line:

VARCHAR OpenMode        = 'read',

Enthusiast

Re: Facing TPT error while lading data from flat file to Teradata

thanks. next day I again reviewed and I got the same problem

Teradata Employee

Re: Facing TPT error while lading data from flat file to Teradata

Not sure what "next day I reviewed and got the same problem" means.

"Reviewing" does not mean "fixing".

This script has several issues.

First, please remove the comma after:

VARCHAR OpenMode        = 'read',

as already suggested.

Next, you need to provide the number of instances for the operators.

All you provided was "[]" in the APPLY and SELECT statements.

-- SteveF