Example: Failure Because the Matching Condition is Defined on a PERIOD Bound Function - Analytics Database - Teradata Vantage

SQL Data Manipulation Language

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
2024-04-05
dita:mapPath
pon1628111750298.ditamap
dita:ditavalPath
qkf1628213546010.ditaval
dita:id
esx1472246586715
lifecycle
latest
Product Category
Teradata Vantage™

This example fails because the matching condition of the MERGE request is defined on a BEGIN Period bound function.

     CREATE TABLE source(
       a INTEGER,
       b PERIOD(DATE),
       c INTEGER);

     CREATE TABLE target(
       i INTEGER,
       j PERIOD(DATE),
       k INTEGER)
     PRIMARY INDEX(i)
     PARTITION BY Begin(j);

     INSERT INTO source(1, PERIOD(DATE, UNTIL_CHANGED), 1);
     MERGE INTO target
       USING source
       ON a=i AND BEGIN(j) = END(b)
     WHEN MATCHED THEN
       UPDATE SET k=c  ;