Example – Specifying Variables for Attributes - 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
DEFINE JOB CREATE_SOURCE_EMP_TABLE
(
      DEFINE OPERATOR DDL_OPERATOR
      DESCRIPTION 'Teradata Parallel Transporter DDL Operator'
      TYPE DDL
      ATTRIBUTES
       (
          VARCHAR TdpID          = @TdpId,
          VARCHAR UserName       = @MyUserName,
          VARCHAR UserPassword   = @MyPassword
);

      APPLY
          ('DROP TABLE SOURCE_EMP_TABLE;'),
          ('CREATE TABLE SOURCE_EMP_TABLE(EMP_ID INTEGER, EMP_NAME CHAR(10));'),
          ('INSERT INTO SOURCE_EMP_TABLE(1,''JOHN'');'),
          ('INSERT INTO SOURCE_EMP_TABLE(2,''PETER'');')
      TO OPERATOR (DDL_OPERATOR);
);

In this example, the DDL operator issues two DDL and two DML statements that create a table and then populates that table with two rows. The values of the TdpId, UserName, and UserPassword operator attributes are specified as job variables.