16.20 - Example – Specifying Variables for Attributes - 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
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.