17.10 - Example: Using PeriodsVX - Advanced SQL Engine - Teradata Database

Teradata Vantage™ - Data Dictionary

Product
Advanced SQL Engine
Teradata Database
Release Number
17.10
Release Date
July 2021
Content Type
Administration
Programming Reference
Publication ID
B035-1092-171K
Language
English (United States)

Suppose you have the following table definition:

CREATE SET TABLE TEST.employee ,NO FALLBACK ,
   NO BEFORE JOURNAL,
   NO AFTER JOURNAL,
   CHECKSUM = DEFAULT,
   DEFAULT MERGEBLOCKRATIO
   (
   eid INTEGER,
   jobdurstart DATE FORMAT 'YY/MM/DD' NOT NULL,
   jobdurend DATE FORMAT 'YY/MM/DD' NOT NULL,
   PERIOD FOR jobdur (jobdurstart, jobdurend),
   ename CHAR(100) CHARACTER SET LATIN NOT CASESPECIFIC)
PRIMARY INDEX ( eid );

The following statement entered in BTEQ retrieves rows from the PeriodsV[X] view for the employee table created:

BTEQ -- Enter your SQL request or BTEQ command:
.SET FOLDLINE ON
.SET SIDETITLES ON
SELECT * FROM DBC.PeriodsVX WHERE table_Name = 'employee';
 *** Query completed. One row found. 8 columns returned.
 *** Total elapsed time was 2 seconds.
   DatabaseName test
    Table_Name employee
   Period_Name jobdur
       Fid  1,028
       Tid 00008D090000
       DBid 0000FA03
START_COLUMN_NAME jobdurstart
 END_COLUMN_NAME jobdurend