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

SQL Data Manipulation Language

Product
Teradata Database
Teradata Vantage NewSQL Engine
Release Number
16.20
Published
March 2019
Language
English (United States)
Last Update
2019-05-03
dita:mapPath
fbo1512081269404.ditamap
dita:ditavalPath
TD_DBS_16_20_Update1.ditaval
dita:id
B035-1146
lifecycle
previous
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  ;