Grouping SQL Statements in the Teradata PT APPLY Statement
You can group several SQL statements together to perform a desired logical database task and still take advantages of the automatic rollback feature on Teradata Database in case of any statement failures or any errors occurring during the transaction.
However, you should have one SQL statement per group if you desire to execute each statement in its own transaction.
When multiple SQL statements are specified in one DML group in the APPLY statement, Teradata Database enforces the rule that if the group contains a DDL statement, it must be the last statement in the implicit transaction, which means the last statement in a group.
Therefore, given that the information in parentheses (below) represents a group, the validity of the statements can be determined as follows:
If a script contains unsupported or invalid statements, the job terminates so the script can be fixed before continuing.