Perform Partial Copy | Teradata Data Mover - 17.11 - About Performing Partial Copies - Teradata Data Mover

Teradata® Data Mover User Guide

Product
Teradata Data Mover
Release Number
17.11
Release Date
October 2021
Content Type
User Guide
Publication ID
B035-4101-091K
Language
English (United States)

When performing a partial copy using XML, embed a sql_where_clause tag and one or more key_column tags within the table tag of the table to perform the partial copy. The sql_where_clause tag specifies the SQL WHERE clause used for the extract side of the partial copy job. The key_column tag is used to specify the name of the columns that uniquely identify each row when upserting them into the target table.

For example:

<table selection="included">
		<name>Table1</name>
		<sql_where_clause><![CDATA[ WHERE col1 > 4]]></sql_where_clause>
 	<key_columns>
			<key_column>col1</key_column>
			<key_column>col2</key_column>
 </key_columns>
</table>

Inside the sql_where_clause tag, the WHERE clause must be surrounded by the special CDATA tag, ![CDATA[ where clause ]], and the WHERE clause must include the WHERE keyword. Do not use a ; character at the end of the SQL.

When performing a partial copy using Teradata PT, the Teradata PT export operator does not support WHERE clauses that can be satisfied by a single AMP operation. For example, a SELECT statement with a constraint containing an equality condition on the primary index or unique secondary index columns of a table such as, WHERE col1 = 1 where col1 is the primary key for the table). In these cases, you should use an alternative copy method.

For optimal results, if at least one of the primary indexes is unique, specify all primary indexes as key columns. For PPI tables, specify all primary indexes and the partitioned columns as key columns. Omitting the partitioned columns when specifying primary indexes can result in job failure.