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

Teradata® VantageCloud Lake

Deployment
VantageCloud
Edition
Lake
Product
Teradata Vantage
Published
January 2023
ft:locale
en-US
ft:lastEdition
2024-12-11
dita:mapPath
phg1621910019905.ditamap
dita:ditavalPath
pny1626732985837.ditaval
dita:id
phg1621910019905

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  ;