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...

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Chapter 3: <strong>Teradata</strong> T<strong>Pump</strong> Commands<br />

DELETE<br />

condition such as underflow, overflow, or division by zero, is treated as an error, and <strong>Teradata</strong><br />

T<strong>Pump</strong> records both row and error code in the error table.<br />

The DELETE statement must identify only one object.<br />

Remember the following when constructing scripts:<br />

• A DELETE statement can be applied to either a table or view, provided that the view does<br />

not specify a join.<br />

• Equality values for all the primary index columns should normally be specified in the<br />

WHERE clause.<br />

The OR construct can be used in the WHERE clause of a DELETE statement; alternatively,<br />

two or more separate DML statements (one per OR term) can be used, with the DML<br />

statements applied conditionally with the APPLY clause of the IMPORT command. The<br />

nature of the alternatives will usually make one of the methods more appropriate.<br />

• The column(s) specified in this clause need not be a part of any index, but can be one or<br />

more nonindexed columns. This clause may specify nonequality values for any<br />

combination of columns of unique indices, or any values for other columns.<br />

• The maximum number of INSERT, UPDATE, and DELETE statements that can be<br />

referenced in an IMPORT is 128. The 128th DML which would cause the insertion of the<br />

DML sequence number of 128 for the DMLSEQ field in the error table could lead to<br />

<strong>Teradata</strong> <strong>Data</strong>base 3520 error.<br />

• The maximum number of DML statements that can be packed into a request is 2430. The<br />

default number of statements packed is 20.<br />

DML validtime qualifier and NONTEMPORAL semantics are supported. For more<br />

information, see SQL <strong>Data</strong> Manipulation Language and SQL <strong>Data</strong> Manipulation Language<br />

Advanced Topics.<br />

Example<br />

The following example uses an input data source containing a series of one-field, four-byte<br />

records. Each record contains the value (EmpNum) of the primary index column (EmpNo) of<br />

a row to be deleted from the Employee table.<br />

.BEGIN LOAD SESSION number;<br />

.LAYOUT Layoutname;<br />

.FIELD EmpNum 1 INTEGER;<br />

.DML LABEL DMLlabelname;<br />

DELETE Employee WHERE EmpNo = :EmpNum;<br />

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

.END LOAD;<br />

112 <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!