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

Teradata® Parallel Transporter User Guide

Product
Parallel Transporter
Release Number
16.20
Published
August 2020
Language
English (United States)
Last Update
2020-08-27
dita:mapPath
uah1527114222342.ditamap
dita:ditavalPath
Audience_PDF_product_tpt_userguide_include.ditaval
To generate a schema, either based on a Teradata Database table or based on the results table of an SQL SELECT statement, Teradata PT must first logon to the appropriate Teradata 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 Teradata 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 Teradata 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 Teradata 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 DSB logon parameters.
  2. If the job variable SourceTable has a value, then that value, a Teradata Database table name, will be the basis for the generated schema, and the Producer set of logon job variables will be queried to obtain DSB 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 Teradata Database table will be the basis for the generated schema, and the Consumer set of logon job variables will be queried to obtain Teradata 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 Teradata 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 Teradata Database table's column descriptions.