Example: Null Expansion Period Producing a Null Expanded Value - 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 shows how a null expansion period produces a null expanded value. In this example, the value for PERIOD(DATE) in column pd is null, so the expansion on pd, expd, is also null.

     CREATE SET TABLE DF2.t4, NO FALLBACK, NO BEFORE JOURNAL,
                              NO AFTER JOURNAL, CHECKSUM = DEFAULT (
       x  INTEGER NOT NULL,
       y  INTEGER NOT NULL,
       pd PERIOD(DATE))
     PRIMARY INDEX (x);

First show that column pd is null.

     SELECT *
     FROM t4;

Result:

      *** Query completed. One row found. 3 columns returned.
      *** Total elapsed time was 1 second.
      x            y           pd
     -----------  -----------  -----------------------------------------
              10           30  ?

Then show that the expansion on pd aliased as expd, is also null.

     SELECT x, expd
     FROM t4
     EXPAND ON pd AS expd;

Result:

      *** Query completed. One row found. 2 columns returned.
      *** Total elapsed time was 1 second.
               x  expd
     -----------  ------------------------------------------------
              10  ?