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 1: Overview<br />

The <strong>Teradata</strong> T<strong>Pump</strong> Task<br />

Macros<br />

The use of macros slightly complicates the privileges for <strong>Teradata</strong> T<strong>Pump</strong>. The remaining<br />

privileges necessary to run a <strong>Teradata</strong> T<strong>Pump</strong> job have two different scenarios:<br />

• When a <strong>Teradata</strong> T<strong>Pump</strong> macro is placed in the same database as the table which it affects,<br />

required rights are INSERT/UPDATE/DELETE on the table affected, corresponding to the<br />

DML executed.<br />

• When a <strong>Teradata</strong> T<strong>Pump</strong> macro is placed in a different database from the table it affects,<br />

required rights specify that the database where the macro is placed must have INSERT/<br />

UPDATE/DELETE, WITH GRANT in the table affected, corresponding to the DML<br />

executed. The EXECUTE MACRO must also be located on the database where the macro<br />

is placed.<br />

Note that when the <strong>Teradata</strong> T<strong>Pump</strong> job uses EXEC to directly specify a macro, the privileges<br />

scenarios are the same, except that the CREATE/DROP MACRO privilege is not required since<br />

the macro exists both before and after the job.<br />

Tables<br />

The corresponding INSERT, UPDATE, or DELETE privilege must exist for each table to be<br />

changed by the <strong>Teradata</strong> T<strong>Pump</strong> task. Multiple tables can be targeted by a single <strong>Teradata</strong><br />

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

The BEGIN LOAD command invokes <strong>Teradata</strong> T<strong>Pump</strong> to execute task processing. Any<br />

statement of this task applies each matching imported data record to each of its target table<br />

rows having the specified index value. <strong>Teradata</strong> T<strong>Pump</strong> supports all table types. Unlike<br />

MultiLoad, there are no forbidden index types. Thus, the tables may be either empty or<br />

populated, as well as being either with or without secondary indices.<br />

All required data is imported; none is obtained from tables already existing in <strong>Teradata</strong><br />

<strong>Data</strong>base. No statement of an IMPORT task may make any reference to a table or row other<br />

than the one affected by the statement.<br />

All INSERT statements, when considered in conjunction with each applicable imported<br />

record, must explicitly specify values for all columns except those for which a default value<br />

(including null) is defined. All UPDATE and DELETE statements, when considered in<br />

conjunction with each applicable imported record, must explicitly specify values for all<br />

columns of the primary index. In order to fulfill this requirement for UPDATE and DELETE<br />

statements, a series of ANDed terms of either form must be supplied:<br />

or<br />

column_reference = colon_variable_reference<br />

column_reference = constant<br />

<strong>Teradata</strong> T<strong>Pump</strong> does not process UPDATE and DELETE statements that contain ORed terms<br />

because <strong>Teradata</strong> T<strong>Pump</strong> must hash the imported records with a value from the import file<br />

(or with a NULL). Any attempt to use an OR with these statements causes <strong>Teradata</strong> T<strong>Pump</strong> to<br />

fail. To work around this, create two separate DML statements and apply them conditionally.<br />

<strong>Teradata</strong> T<strong>Pump</strong> imposes some restrictions on the updates of an IMPORT task. It rejects<br />

updates that try to change the value of the primary index of a row, but accepts even reflexive<br />

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

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

Saved successfully!

Ooh no, something went wrong!