ViewTable - Analytics Database - Teradata Vantage

SQL Request and Transaction Processing

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-10-04
dita:mapPath
zfm1628111633230.ditamap
dita:ditavalPath
qkf1628213546010.ditaval
dita:id
evd1472255317510
lifecycle
latest
Product Category
Teradata Vantage™

Function of ViewTable

Captures the DDL for any views used in a query.

ViewTable Table Definition

The following CREATE TABLE request defines ViewTable:

   CREATE SET TABLE ViewTable(
     QueryID   INTEGER NOT NULL,
     ViewName  VARCHAR128 CHARACTER SET UNICODE
               UPPERCASE NOT CASESPECIFIC NOT NULL,
     DBName    VARCHAR128 CHARACTER SET UNICODE
               UPPERCASE NOT CASESPECIFIC NOT NULL,
     ViewText  VARCHAR(30000) CHARACTER SET UNICODE
               NOT CASESPECIFIC,
     SeqNumber BYTEINT NOT NULL,
     Complete  CHAR(1)CHARACTER SET LATIN NOT CASESPECIFIC)
   PRIMARY INDEX QueryID_ViewName_DBName (QueryID,ViewName,DBName);

Attribute Definitions for ViewTable

The following table defines the ViewTable attributes:

Attribute Definition
QueryID
  • Unique identifier for the query.
  • Partial NUPI for the table.
ViewName
  • Name of the view.
  • Partial NUPI for the table.
DBName
  • Name of the database.
  • Partial NUPI for the table.
ViewText Stores the DDL view text.
  • If ViewText <= 30,000 characters, SeqNumber is set to 1.
  • If ViewText > 30,000 characters, SeqNumber is set to 1 + (1-n), where n is the identifier for the fragment of ViewText stored in the row following the first fragment.

When ViewText > 30,000 characters, only the first 30,000 are stored and the remaining text is stored in overflow rows within ViewTable. The overflow rows are identified by their SeqNumber value.

SeqNumber The sequence of ViewText stored in this row.
Complete Identifies whether ViewTable stores the complete view DDL or a truncated version.
  • If F, ViewText DDL is truncated.

    This case occurs when the size specified in the LIMIT SQL clause of the DUMP EXPLAIN or INSERT EXPLAIN statement that captured the view is less than the actual length of ViewText.

    See Teradata Vantage™ - SQL Data Manipulation Language, B035-1146.

  • If T, Full ViewText DDL is stored.

    Overflow ViewText DDL is stored in additional rows in ViewTable. Individual overflow rows are identified by their respective SeqNumber.