TPT Script - Job Compilation error

Tools & Utilities
Enthusiast

TPT Script - Job Compilation error

Hello, I am trying to export from a table and load another table directly, without using any flat files. Getting an error. Part of the script is below. The error is about (text was '▒'), but I cannot find this character in the script. Line 76 is where the target tble, logtable and error tables are defined. Thanks for your help.

 

DEFINE OPERATOR LOAD_OPERATOR

TYPE LOAD

Schema *

ATTRIBUTES

(

VARCHAR PrivateLogName = 'TPT_Load_log',

VARCHAR TdpId='sys1',

VARCHAR UserName='username',

VARCHAR UserPassword='password’,

VARCHAR TargetTable='dbname.TPT_LOAD_TEST',

VARCHAR LogTable=‘dbname.TPT_LOAD_TEST_LG’,

VARCHAR ErrorTable1=‘dbname.TPT_LOAD_TEST_ET’,

VARCHAR ErrorTable2=‘dbname.TPT_LOAD_TEST_UV’

) ;

 

STEP Setup_Tables

(

APPLY

(‘DROP TABLE dbname.TPT_LOAD_TEST_ET;’),

(‘DROP TABLE dbname.TPT_LOAD_TEST_UV;’),

(‘DROP TABLE dbname.TPT_LOAD_TEST_LG;’)

);

 

STEP LOAD_TRANS_TABLE

(

 

APPLY TO OPERATOR (LOAD_OPERATOR)

SELECT * FROM OPERATOR (EXPORT_OPERATOR);

);

 

);

 

*********************************

*     Linux Execution          *

*********************************

+ LANG=en_US

+ export LANG

+ LC__FASTMSG=false

+ export LC__FASTMSG

+ set -x

+ /opt/teradata/client/16.20/bin/tbuild -f /etl/dev/scripts/tpt_test.sql

Teradata Parallel Transporter Version 16.20.00.09 64-Bit

The global configuration file '/opt/teradata/client/16.20/tbuild/twbcfg.ini' is used.

   Log Directory: /opt/teradata/client/16.20/tbuild/logs

   Checkpoint Directory: /opt/teradata/client/16.20/tbuild/checkpoint

 

TPT_INFRA: TPT02932: Error: Invalid token near line 76 (text was '▒')

TPT_INFRA: TPT04017: Exception "Invalid token" caught during job script file parsing/compilation.

Job script compilation failed.

 

Job terminated with status 8.

 

Tags (2)

Accepted Solutions
Teradata Employee

Re: TPT Script - Job Compilation error

Look closely at the script. In the excerpt you posted, you have some "left single quotation mark" and "right single quotation mark"  where you need a simple "apostrophe" (').

1 ACCEPTED SOLUTION
5 REPLIES 5
Teradata Employee

Re: TPT Script - Job Compilation error

Look closely at the script. In the excerpt you posted, you have some "left single quotation mark" and "right single quotation mark"  where you need a simple "apostrophe" (').

Enthusiast

Re: TPT Script - Job Compilation error

Thanks Fred for the quick response. I copied some of the text from the smaple on the Teradata site, and inadvertantly copied those quotes and some unprintable characters. Typed it all again and it worked well.

 

I have a backup table already built with data. I do not want to keep rebuilding the table each time, but prefer to do a kill and fill from the prod table. Is this possible with a LOAD operator or do I have to use the UPDATE. 

Highlighted
Teradata Employee

Re: TPT Script - Job Compilation error

Hi Renji,

 

If I understand those terms right : rebuild = drop + create with data / kill & fill = delete + insert

You can issue a delete sql command in the DDL step prior to the load step, should be ok.

Enthusiast

Re: TPT Script - Job Compilation error

Thanks Waldar for your response. My need is to copy Table1 from Prod environment into two lower environments to keep the table in sync.

 

The Schema is defined.

The DDL_Operator points to the source table in Prod

The Export Operator have the information with the select statement

I have LOAD_OPERATOR_1, SETUP_TABLES_1, LOAD_TRANS_TABLE_1 for one environment and a second set for the second environment.

 

When the target tables are empty, it is loading both environments. But it doesn’t seem to pick up the Setup_Tables step. There were no errors, so there was nothing to drop. If the target table is populated, it throws an error, saying that the target table needs to be empty.

 

STEP Setup_Tables_1

(

APPLY

('DROP TABLE PROD_ACTG.TPT_LOAD_TEST_LG ;'),

('DROP TABLE PROD_ACTG.TPT_LOAD_TEST_ET ;'),

('DROP TABLE PROD_ACTG.TPT_LOAD_TEST_UV ;'),

('DELETE FROM PROD_ACTG.TPT_LOAD_TEST_11 ALL ;')

TO OPERATOR (LOAD_OPERATOR_1) ;

) ;

 

STEP Setup_Tables_Stg

(

APPLY

('DROP TABLE PROD_ACTG.TPT_LOAD_TEST_LG ;'),

('DROP TABLE PROD_ACTG.TPT_LOAD_TEST_ET ;'),

('DROP TABLE PROD_ACTG.TPT_LOAD_TEST_UV ;'),

('DELETE FROM PROD_ACTG.TPT_LOAD_TEST_12 ALL ;')

TO OPERATOR (LOAD_OPERATOR_2) ;

) ;

 

STEP LOAD_TRANS_TABLE_1

(

APPLY

( 'INSERT INTO PROD_ACTG.TPT_LOAD_TEsT_11

     VALUES (:EMP_ID, :LAN_ID, :FST_NM, :LST_NM, :COST_CENTER_ID, :EMP_STATUS, :UPD_DATE) ; ' )

     TO OPERATOR (LOAD_OPERATOR_1)

SELECT * FROM OPERATOR (EXPORT_OPERATOR) ;

) ;

 

STEP LOAD_TRANS_TABLE_2

(

APPLY

( 'INSERT INTO PROD_ACTG. TPT_LOAD_TEST_12

     VALUES (:EMP_ID, :LAN_ID, :FST_NM, :LST_NM, :COST_CENTER_ID, :EMP_STATUS, :UPD_DATE) ; ' )

     TO OPERATOR (LOAD_OPERATOR_2)

SELECT * FROM OPERATOR (EXPORT_OPERATOR) ;

) ;

Teradata Employee

Re: TPT Script - Job Compilation error

You need to APPLY the DROP / DELETE to a DDL Operator instance for the target, not to a Load Operator.