Copy a View Definition | Teradata Data Mover - About Copying a View Definition - Teradata Data Mover

Teradata® Data Mover User Guide

Product
Teradata Data Mover
Release Number
17.00
Published
November 30, 2021
Language
English (United States)
Last Update
2021-11-04
dita:mapPath
gmn1574692806523.ditamap
dita:ditavalPath
cjo1509024828169.ditaval
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.

The following restrictions apply:
  • If the object being copied does not exist on the target database, it is created on the target database. If the object does exist on the target database, the object is overwritten – unless the overwrite_existing_objects property is set to false. In that case, a create time error is generated.
  • You cannot relocate or rename views.
  • You cannot copy view definitions to Hadoop.
  • 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.
  • Attempting to rename or relocate referenced tables results in an error when you create the view definition on the target system.