Special Job Variables for Inferring and Generating a Schema - Parallel Transporter

Teradata® Parallel Transporter User Guide

Product
Parallel Transporter
Release Number
17.00
Published
August 31, 2020
Language
English (United States)
Last Update
2020-08-27
dita:mapPath
zae1544831938751.ditamap
dita:ditavalPath
tvt1507315030722.ditaval
dita:id
B035-2445
lifecycle
previous
Product Category
Teradata Tools and Utilities
To generate a schema, either based on a database table or based on the results table of an SQL SELECT statement, Teradata PT must first logon to the appropriate database to get the column descriptions of the schema to be generated. If the template operator reference itself has logon attribute assignments in its ATTRIBUTES list, then those values will be used for database logon. If not, then Teradata PT queries one of two sets of special conventionally-named job variables, either of which, when assigned values, will control Teradata PT's logon to the desired database:
Producer Logon Variables
<Producer Operator Name>TdpId or if not set SourceTdpId
<Producer Operator Name>UserName or if not set SourceUserName
<Producer Operator Name>UserPassword or if not set SourceUserPassword
<Producer Operator Name>AccountId or if not set SourceAccountId
<Producer Operator Name>WorkingDatabase or if not set SourceWorkingDatabase
Consumer Logon Variables
<Consumer Operator Name>TdpId or if not set TargetTdpId
<Consumer Operator Name>UserName or if not set TargetUserName
<Consumer Operator Name>UserPassword or if not set TargetUserPassword
<Consumer Operator Name>AccountId or if not set TargetAccountId
<Consumer Operator Name>WorkingDatabase or if not set TargetWorkingDatabase

When Teradata PT attempts to generate the schema for a producer template, it checks three conditions in order to determine which of the above sets of logon job variables will be queried to provide database logon parameters:

  1. If the job variable SelectStmt has a value, or if the template reference includes a SelectStmt attribute assignment, then that value, an SQL SELECT statement, from either of these sources will be the basis for the generated schema, and the Producer set of logon job variables will be queried to obtain database logon parameters.
  2. If the job variable SourceTable has a value, then that value, a database table name, will be the basis for the generated schema, and the Producer set of logon job variables will be queried to obtain database logon parameters.
  3. If the job variable TargetTable has a value, or if the consumer operators in the job step of producer template collectively identifies one and only one target table, via a TargetTable attribute assignment, then that database table will be the basis for the generated schema, and the Consumer set of logon job variables will be queried to obtain database logon parameters.

If the set of logon job variables queried yields logon parameters, and Teradata PT gets the schema column descriptions from the requested database, Teradata PT still must determine which schema format to generate: the delimited-file format or the regular column-mapped format. Teradata PT supports one more special job variable that provides this information:

SourceFormat

Before generating the DEFINE SCHEMA statement, Teradata PT queries the special job variable SourceFormat. If has the value Delimited, then the generated schema will be in delimited-file format; otherwise, it will be in the normal format in which the schema column definitions closely match the database table's column descriptions.