Teradata Parallel Data Pump
Teradata Parallel Data Pump Reference - Teradata Developer ...
Teradata Parallel Data Pump Reference - Teradata Developer ...
- No tags were found...
Create successful ePaper yourself
Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.
Chapter 3: <strong>Teradata</strong> T<strong>Pump</strong> Commands<br />
EXECUTE<br />
• <strong>Teradata</strong> T<strong>Pump</strong> expects the parameter list for any macro to match the FIELD list specified<br />
by the LAYOUT in the script. FILLER fields are ignored. If the USE clause is used in the<br />
DML statement, <strong>Teradata</strong> T<strong>Pump</strong> expects the parameter list for every macro in the DML<br />
statement to match the field list specified by the USE clause. The order should be the same<br />
as the fields in the LAYOUT.<br />
• The macro should specify a single prime index operation: INSERT, UPDATE, DELETE, or<br />
UPSERT. <strong>Teradata</strong> T<strong>Pump</strong> reports an error if the macro contains more than one<br />
supported statement.<br />
• The restrictions on INSERT, UPDATE, DELETE, and UPSERT statements supported by<br />
<strong>Teradata</strong> T<strong>Pump</strong> are described in the corresponding sections of this manual.<br />
If the EXECUTE statement is replacing an INSERT, UPDATE, DELETE, or UPSERT statement<br />
in a job script, the EXECUTE statement must be placed at the same location as the INSERT,<br />
UPDATE, DELETE, or UPSERT statement that it replaces. The following example shows an<br />
INSERT statement is replaced by an equivalent predefined macro:<br />
.DML LABEL LABELA;<br />
DELETE ;<br />
INSERT ;<br />
UPDATE ;<br />
.DML LABEL LABELA ;<br />
DELETE ;<br />
EXECUTE INSERT ;<br />
UPDATE ;<br />
The correct syntax for a <strong>Teradata</strong> T<strong>Pump</strong> predefined macro is one of the following:<br />
• CREATE MACRO () as (UPDATE....; ) ;<br />
• CREATE MACRO () as (INSERT.....; ) ;<br />
• CREATE MACRO () as (DELETE.....; ) ;<br />
• CREATE MACRO () as (UPSERT.....; ) ;<br />
If a <strong>Teradata</strong> <strong>Data</strong>base server supports Atomic upsert, then automatic use of Atomic upsert is<br />
allowed, when possible, without changing existing <strong>Teradata</strong> T<strong>Pump</strong> scripts. This is<br />
accomplished in the following manner:<br />
• <strong>Teradata</strong> T<strong>Pump</strong> attempts to use the Atomic upsert syntax in defining a single UPSERT<br />
macro (instead of an UPDATE/INSERT macro pair).<br />
• If the UPSERT macro is successfully defined, <strong>Teradata</strong> T<strong>Pump</strong> uses the Atomic upsert<br />
function for the UPSERT.<br />
• If an error occurs during UPSERT macro definition, presumably due to a violation of<br />
<strong>Teradata</strong> <strong>Data</strong>base Atomic upsert restrictions, <strong>Teradata</strong> T<strong>Pump</strong> issues a warning and<br />
reverts to the current <strong>Teradata</strong> T<strong>Pump</strong> upsert method of paired UPDATE/INSERT<br />
statements.<br />
<strong>Teradata</strong> T<strong>Pump</strong> will continue to operate as it does now when the existing <strong>Teradata</strong> T<strong>Pump</strong><br />
syntax for upsert is encountered, and references to predefined macros are used for either the<br />
UPDATE or the INSERT or both.<br />
<strong>Teradata</strong> <strong>Parallel</strong> <strong>Data</strong> <strong>Pump</strong> Reference 131