About Copying a View Definition - Teradata Data Mover

Teradata Data Mover User Guide

Product
Teradata Data Mover
Release Number
16.00
Published
December 2016
Language
English (United States)
Last Update
2018-03-29
dita:mapPath
rdo1467305237457.ditamap
dita:ditavalPath
ft:empty
dita:id
B035-4101
lifecycle
previous
Product Category
Analytical Ecosystem

The following xml demonstrates how to copy a view definition:

<views>
	<view selection="included">
		<name>deptsals</name>
		<database>MyDb</database>
	</view>
</views>

Set the selection as "included" to copy the view definition deptsals from the source system to the target system using the name of the <view> and the <database> where the view exists on the source system.

If the view definition does not exist on the target, it is created on the target database. If the view already exists on the target, the target view definition is overwritten, unless the overwrite_existing_objects property is set to false. In that case, a create time error is generated.

The following restrictions apply:
  • You cannot relocate or rename views.
  • If the table names in the view definition are not fully qualified, those tables must exist in the database having the same name as the source view database to avoid an error.

    For example, the following view definition contains a non-fully qualified view name and table name:

    CREATE VIEW deptsals AS SELECT department_number AS department
    FROM  employee
    HAVING salary_amount < 36000;
    
  • If the table on which the view is created does not exist on the target, or is not being moved as part of the job, an error results when attempting to create the view definition on the target system.
  • When copying an entire database, ARC automatically copies the view definitions to the target. Trying to also specify the <view> element with selection="included" in this scenario results in an error.
  • Attempting to rename or relocate referenced tables results in an error when you create the view definition on the target system.