16.10 - Specifying DDL Statements in the Teradata PT APPLY Statement - Parallel Transporter

Teradata Parallel Transporter Reference

Product
Parallel Transporter
Release Number
16.10
Published
July 2017
Content Type
Programming Reference
Publication ID
B035-2436-077K
Language
English (United States)

The SQL statements that the DDL operator supports are specified in the Teradata PT APPLY statement.

The following examples show how to specify DDL statements in the APPLY statement:

  • One SQL statement per group
     APPLY
          'ddl stmt1',
          'ddl stmt2',
          .........
          'ddl stmt3'
       TO OPERATOR (operator specification)
  • Multiple SQL statements in a group, but only one group
     APPLY
          ('ddl stmt1','ddl stmt2', ... ,'ddl stmtn')
       TO OPERATOR (operator specification)
  • Multiple SQL statements per group, and multiple groups
     APPLY
          ('ddl stmt11','ddl stmt12', ... ,'ddl stmt1n'),
    .
    .
    .
         ('ddl stmtx1','ddl stmtx2', ... ,'ddl stmtxm')
       TO OPERATOR (operator specification)

If more than one statement is specified in one group, then the DDL operator combines all statements into one single multistatement request and sends it to the Teradata Database as one implicit transaction. This means that any statement failure or any error rolls back the entire transaction.

The SQL statements are executed by groups in the order they are specified in the APPLY statement.Currently, the maximum number of SQL statement groups that can be specified in the APPLY statement is 1024. If the number of SQL statement groups is greater than 1024, Teradata PT terminates the job with the TPT05537 error message.