Using templates for operators provided in TPT

Tools
Enthusiast

Using templates for operators provided in TPT

Hi,

How can we use the templates for the operators provided in TPT?

I am having problem in providing schema for producer operators...

Here is the script

DEFINE JOB jobname

DESCRIPTION '---'

(

DEFINE SCHEMA countries_SCHEMA @LoadTargetTable;

APPLY $INSERT @LoadTargetTable TO OPERATOR ($LOAD)

SELECT * FROM OPERATOR ($EXPORT('countries_SCHEMA'));

);

All variables are in seperate job variable file.

Error is - Unmatched function parenthesis -- '(' -- for operator EXPORT

I went through the manuals but counldn't come up with solutions.

I am using Teradata version - 13.10.03.08

Iam not sure what iam doing wrong ... please help me out

20 REPLIES
Teradata Employee

Re: Using templates for operators provided in TPT

I am not sure this will totally solve the problem, but you should not be putting a table name after the $INSERT.

-- SteveF
Enthusiast

Re: Using templates for operators provided in TPT

Hi

Iam pasting a tpt script snippet from TPT User Guide 14.0,  (page - 240)

Example 1: Job Script with Simplified Syntax

DEFINE JOB PLOAD_JOB

DESCRIPTION 'PLOAD JOB'

(

/* Use the schema of the TargetTable for TPT_SCHEMA */

DEFINE SCHEMA TPT_SCHEMA DELIMITED @LoadTargetTable;

APPLY $INSERT @LoadTargetTable TO OPERATOR ($LOAD [@LoadInstances])

SELECT * FROM OPERATOR ($FILE_READER(TPT_SCHEMA) [@ReaderInstances]);

);

Is this snippet wrong? Tablename is present after $INSERT.

Could you tell me about any other way to make TPT script reusable, upto a certain limit..

Thanks

Nitin

Teradata Employee

Re: Using templates for operators provided in TPT

Snippet is not wrong. I was unaware of that new syntax enhancement.

Please provide the entire (real) script (not the snippet from the manual).

-- SteveF
Teradata Employee

Re: Using templates for operators provided in TPT

Based on the script in the very first post, if that is indeed the script you submitted, please remove the single quotes from around the countries_SCHEMA after the $EXPORT.

-- SteveF
Teradata Employee

Re: Using templates for operators provided in TPT

Please provide me with the contents of the job variable file. When we take the script sample from the very first post (and provide our own values for the job variables), we do not get the same issue as you.

-- SteveF
Enthusiast

Re: Using templates for operators provided in TPT

Hi

Here is the script - sample_country.tpt

DEFINE JOB load_sample_country

(

DEFINE SCHEMA countries_schema @LoadTargetTable;

APPLY $INSERT @LoadTargetTable

TO OPERATOR ($LOAD)

SELECT * FROM OPERATOR ($EXPORT(countries_schema));

);

Here is the job variable file - jobvar.txt

LoadPrivateLogName = 'loadoper_private_log',

LoadTargetTable = 'sample_country',

LoadWorkingDatabase = 'dbname',

LoadErrorTable1 = 'e1__sample_country',

LoadErrorTable2 = 'e2_sample_country',

LoadLogTable = 'log_sample_country',

LoadMaxSessions = 5,

LoadMinSessions = 1,

ExportPrivateLogName = 'exportoper_private_log',

ExportMaxSessions = 5,

ExportMinSessions = 1,

ExportSelectStmt = 'select * from dbname.countries;',

TargetUserName = 'username',

TargetUserPassword = 'password',

TargetTdpId = 'ipaddress',

SourceUserName = 'username',

SourceUserPassword = 'password',

SourceTdpId = 'ipaddress'

Here sample_country and countries table have same structure.

"sample_country" is my target table while iam extracting data from "countries" table.

TPT Version - 13.10.00.02

Iam getting the same error -

Unmatched function parenthesis -- '(' -- for operator EXPORT.

Please help me out. I really can't understand what  iam doing wrong.

Teradata Employee

Re: Using templates for operators provided in TPT

Ok, spoke with the engineer:

Explicit schema association via the statement

                SELECT * FROM OPERATOR ($EXPORT(countries_schema));

is not supported in 13.10; they need to remove the schema reference:

                SELECT * FROM OPERATOR ($EXPORT());

You can refer them to the  'Inferred Schemas' sub-section of the section 'Simplifying Scripts with Operator Templates and Inferred Schemas' in Chapter 27 of the 13.10 TPT User Guide for specifics on how template operators get associated with schemas.

-- SteveF
Enthusiast

Re: Using templates for operators provided in TPT

Hi Feinholz

Thanks for the reply.

I searched the Teradata website but could not find user guide for tpt version 13.1.

I could find version 13 is present , and it does not contain 'Simplifying Scripts with Operator Templates and Inferred Schemas' in Chapter 27. Could you send me a link from where i can find the user guide 13.1.

Thanks again

Nitin

Teradata Employee

Re: Using templates for operators provided in TPT

All of our docs for all releases are in the same place.

Thus, if you can see the TPT 13.00 docs, you should be able to see the TPT 13.10 docs.

http://www.info.teradata.com/

-- SteveF