25.09.2015 Views

Teradata Parallel Data Pump

Teradata Parallel Data Pump Reference - Teradata Developer ...

Teradata Parallel Data Pump Reference - Teradata Developer ...

SHOW MORE
SHOW LESS
  • 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 />

DML<br />

.BEGINLOAD SESSION number;<br />

.LAYOUT Layoutname;<br />

.FIELD EmpNum 1 INTEGER;<br />

.FIELD Fone * (CHAR (10));<br />

.DML LABEL DMLlabelname<br />

DO INSERT FOR MISSING UPDATE ROWS;<br />

UPDATE Employee SET PhoneNo = :Fone WHERE EmpNo = :EmpNum;<br />

INSERT Employee (EmpNo, PhoneNo) VALUES (:EmpNum, :Fone);<br />

.IMPORT INFILE Infilename LAYOUT Layoutname APPLY DMLlabelname;<br />

.END LOAD;<br />

The scope of a DML command (and its label) terminates at the first following command of<br />

any kind or at the end of the file containing the DML statements, whichever occurs first.<br />

The SQL EXECUTE command must be between the BEGIN LOAD command and END<br />

LOAD command.<br />

For IMPORT tasks, up to seven distinct error treatment options for one DML command may<br />

be specified. For example:<br />

.DML LABEL COMPLEX<br />

IGNORE DUPLICATE INSERT ROWS<br />

MARK DUPLICATE UPDATE ROWS<br />

IGNORE MISSING UPDATE ROWS<br />

MARK MISSING DELETE ROWS<br />

DO INSERT FOR MISSING UPDATE ROWS;<br />

It is valid to specify that missing update rows be both marked and treated as INSERTs or, as in<br />

the example, both ignored and treated as INSERTs.<br />

If <strong>Teradata</strong> T<strong>Pump</strong> encounters any of the following:<br />

• no DML command in an IMPORT task,<br />

• DML statements outside the scope of a DML command in an IMPORT task, or<br />

• a DML command with no DML statements in an IMPORT task,<br />

it writes a diagnostic message to the primary output destination for the system, terminates the<br />

<strong>Teradata</strong> T<strong>Pump</strong> task, and returns to the main <strong>Teradata</strong> T<strong>Pump</strong> control module with a<br />

conventional nonzero return code. The error can be corrected and resubmitted to the <strong>Teradata</strong><br />

T<strong>Pump</strong> task.<br />

The DML commands (with their following DML statements) must appear between the<br />

appropriate BEGIN LOAD command and the IMPORT commands that refer to them. When<br />

the END LOAD command is encountered, the sequence of DML commands and DML<br />

statements is forgotten. The DML command cannot be shared by multiple BEGIN LOAD<br />

statements. The DML statements are described in the following sections.<br />

The maximum number of DML commands that can be used in a single <strong>Teradata</strong> T<strong>Pump</strong> task<br />

is 128. If an excessive number of DML commands and statements are sent to <strong>Teradata</strong><br />

<strong>Data</strong>base, an error message is logged, stating that there are too many DML steps for one<br />

<strong>Teradata</strong> T<strong>Pump</strong> job.<br />

124 <strong>Teradata</strong> <strong>Parallel</strong> <strong>Data</strong> <strong>Pump</strong> Reference

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!