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

Teradata® Data Mover User Guide - 20.01

Deployment
VantageCloud
VantageCore
Edition
Enterprise
IntelliFlex
Lake
VMware
Product
Teradata Data Mover
Release Number
20.01
Published
November 2023
Language
English (United States)
Last Update
2023-12-05
dita:mapPath
hlv1700545853003.ditamap
dita:ditavalPath
mpm1591127278842.ditaval
dita:id
don1467241476387
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.
  • 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.
  • If you want to copy a view definition without copying the underlying table, you can use DSA. See About Copying Views, Macros, and Stored Procedures Using DSA.
  • Attempting to rename or relocate referenced tables results in an error when you create the view definition on the target system.