17.00 - Example: Using PeriodsVX - Teradata Database

Teradata Vantage™ - Data Dictionary

prodname
Advanced SQL Engine
Teradata Database
vrm_release
17.00
created_date
June 2020
category
Administration
Programming Reference
featnum
B035-1092-170K

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