16.20 - Writing the tpt Script - Teradata Database - Teradata Vantage NewSQL Engine

Teradata Vantage™ - NewSQL Engine Analytic Functions

Product
Teradata Database
Teradata Vantage NewSQL Engine
Release Number
16.20
Release Date
July 2019
Content Type
Programming Reference
Publication ID
B035-1206-162K
Language
English (United States)
  • Write the tpt script by substituting values for variables in the following script:
    DEFINE JOB PRODUCT_SOURCE_LOAD
    
    DESCRIPTION 'LOAD PRODUCT DEFINITION TABLE'
      (
        DEFINE SCHEMA PRODUCT_SOURCE_SCHEMA
        DESCRIPTION 'PRODUCT INFORMATION SCHEMA'
          (
            TD_compatible_table_definition
    
          STEP STEP_CREATE_DDL
          (
            APPLY
            ('DROP TABLE '||@TargetTable||' ;'),
            ('CREATE MULTISET TABLE '||@TargetTable||'(TD_compatible_table_definition;')
          TO OPERATOR ($DDL() [1]);
      );
      Step Insert_Tables
      (
        APPLY
        ('Ins '||@TargetTable||'(
          :"column_name_1"
          ,:"column_name_2"
          [...,:"column_name_k"]
        );
      )
      TO OPERATOR ($LOAD()[1])
    
      SELECT * FROM OPERATOR ($ODBC(PRODUCT_SOURCE_SCHEMA)[1]);
      );
    );