MERGE with PTI Table Usage Notes | Teradata Vantage - Usage Notes - Analytics Database - Teradata Vantage

Time Series Tables and Operations

Deployment
VantageCloud
VantageCore
Edition
Enterprise
IntelliFlex
VMware
Product
Analytics Database
Teradata Vantage
Release Number
17.20
Published
June 2022
Language
English (United States)
Last Update
2023-10-30
dita:mapPath
tuc1628112453431.ditamap
dita:ditavalPath
qkf1628213546010.ditaval
dita:id
sfz1493079039055
lifecycle
latest
Product Category
Teradata Vantageā„¢

Refer to the following rules and restrictions when using MERGE statements with PTI tables.

You cannot specify the system generated TD_TIMEBUCKET column in a MERGE statement, including column_name, column_name_list, subquery_source, expression, in a WHERE clause, and so forth. However, you can use the TD_GETTIMEBUCKET function to retrieve TD_TIMEBUCKET column values.

When you merge data into a PTI table, the system automatically generates the TD_TIMEBUCKET value based on the TD_TIMECODE.

When the target table is a PTI table, you must specify the following columns in the ON clause with an equality predicate:
  • TD_TIMECODE column.
  • TD_SEQNO column, for a sequenced PTI table.
  • Each column specified in the COLUMNS clause.

When merging into a PTI table, you cannot merge rows where the source TD_TIMECODE value precedes the time zero value specified in the target table PTI clause, such as DATE '2016-01-03'.

The table lists the various merge combinations.

Source Table Target Table ON Clause
PTI table PTI table Must specify an equality predicate for each of the following columns:
  • TD_TIMECODE column
  • Each column in the COLUMNS specification.
  • TD_SEQNO column for a sequenced table.
non-PTI table PTI table
PTI table non-PTI table Must specify an equality predicate for each of the following columns:
  • Each PI column in the primary index clause.
  • Each PPI column in the PARTITION BY clause.