Use this procedure to implement multiple data targets in an APPLY statement in the executable section of a script (after the DEFINE statements).
In all of the following syntax examples, <DML spec x> represents the DML statements to be applied to data target x. For more information, see “APPLY Statement” in the Teradata Parallel Transporter Reference (B035-2436).
Define an APPLY clause for the first target, specifying its consumer operator:
APPLY <DML spec> TO OPERATOR <consumer_operator>
- Repeat Step 1 for a maximum of 32 targets, separating each APPLY clause by a comma. Omit the comma after the last one.
Define one or more sources with any combination of the following:
Use a SELECT statement for each reference to a producer operator or database object.
Use a UNION ALL statement to combine multiple SELECT statements.
Use the following syntax to define multiple sources:
SELECT <column_list> FROM <producer_operator1> UNION ALL SELECT <column_list> FROM <producer_operator2> UNION ALL SELECT <column_list> FROM <producer_operator3>
For more information about the required and optional attributes for the APPLY clause, see “APPLY Statement” in the Teradata Parallel Transporter Reference (B035-2436).
For more information about the UNION ALL option, see UNION ALL: Combining Data from Multiple Sources.