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

• UPDATE-WHERE-CURRENT: Syntax not supported. The WHERE clause cannot use an<br />

updatable cursor to do what is called a positioned UPDATE. (It is unlikely that this syntax<br />

will ever be supported.) Note that this restriction does not prevent cursors from being<br />

used in other ways with Atomic upsert statements. For example, a DECLARE CURSOR<br />

statement may include upsert statements among those to be executed when the cursor is<br />

opened, as long as the upserts are otherwise valid.<br />

• UPDATE-FROM: Not supported. The SET clause cannot use a FROM clause table<br />

reference in the expression for the updated value for a column.<br />

• UPDATE-WHERE SUBQUERIES: Not supported. The WHERE clause cannot use a<br />

subquery either to specify the primary index or to constrain a nonindex column. Note that<br />

supporting this UPDATE syntax would also require support for either INSERT … SELECT<br />

or some other INSERT syntax feature that lets it specify the same primary index value as<br />

the UPDATE.<br />

• UPDATE-PRIMARY INDEX: Not supported. The UPDATE cannot change the primary<br />

index. This is sometimes called unreasonable update.<br />

• TRIGGERS: Feature not supported if either the UPDATE or INSERT could cause a trigger<br />

to be fired. The restriction applies as if the UPDATE and INSERT were both executed,<br />

because the parser trigger logic will not attempt to account for their conditional execution.<br />

UPDATE triggers on columns not referenced by the UPDATE clause, however, will never<br />

be fired by the upsert and are therefore permitted. DELETE triggers cannot be fired at all<br />

by an upsert and are likewise permitted. Note that an upsert could be used as a trigger<br />

action but it would be subject to the same constraints as any other upsert. Because an<br />

upsert is not allowed to fire any triggers itself, an upsert trigger action must not generate<br />

any further cascaded trigger actions.<br />

• JOIN/HASH INDEXES: Feature not supported if either the UPDATE or INSERT could<br />

cause the join/hash index to be updated. As with triggers, the restriction applies to each<br />

upsert as if the UPDATE and INSERT were both executed. While the UPDATE could<br />

escape this restriction if the join/hash index does not reference any of the updated<br />

columns, it is much less likely (and maybe impossible) for the INSERT to escape. If the<br />

benefit of lifting the restriction for a few unlikely join/hash index cases turns out to be not<br />

worth the implementation cost, the restriction may have to be applied more broadly to any<br />

table with an associated join/hash index.<br />

Treat the failed constraint as a nonfatal error, report the error in the job log for diagnostic<br />

purposes, and continue with the job by reverting to the old non-Atomic upsert protocol.<br />

Existing <strong>Teradata</strong> T<strong>Pump</strong> Scripts<br />

Existing <strong>Teradata</strong> T<strong>Pump</strong> scripts for upserts do not need to be changed. The syntax as<br />

described below for an upsert will continue to be supported:<br />

DO INSERT FOR MISSING UPDATE ROWS;<br />

UPDATE ;<br />

INSERT ;<br />

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