Domains Form | Database Design | Teradata Vantage - 17.10 - Domains Form - Advanced SQL Engine - Teradata Database

Teradata Vantageā„¢ - Database Design

Product
Advanced SQL Engine
Teradata Database
Release Number
17.10
Release Date
July 2021
Content Type
User Guide
Publication ID
B035-1094-171K
Language
English (United States)

Lists and describes all the domains for a database.

This form supports the first step in the ATM process (see Goals of the ATM Process).

Information Recorded in the Domains Form

The Domains form records the following information about each domain:

Information Recorded Description
ELDM Page Page of the Extended Logical Data Model to which this domain pertains.
System Name of the system on which this domain is defined.
Domain Name Name of the domain.

This is often the same name as the UDT corresponding to the domain.

Domain Description Full text description of the domain.
Data Type Encoded data type for the domain.

You must create your own encodings for UDTs if you use them to define your domains.

Max Bytes Maximum number of bytes a column value drawn from this domain can occupy in disk storage.

Note that the number of bytes per character does not necessarily map 1:1 to the number of characters defined for the column by the defined data type. Multibyte character sets are often represented by multiple bytes per single character, and you must account for this information when filling out the Domains form.

Print Format Representation of the FORMAT clause (if any) used in the definition of columns drawn from this domain.
Constraint # Constraint number (as recorded on the Constraints form) that applies to this domain, if any.

Data Type Codes

You should also maintain a list of UDTs and the codes you assign to them, staying as close to the existing code naming convention as possible.

The following table lists the valid predefined data types and their DBC.TVFields codes.

Data Type Code
ARRAY (one-dimensional)

VARRAY (one-dimensional)

You cannot use any of the predefined UDT data types as the base type for creating a distinct UDT, so you cannot create a domain using a distinct UDT based on a one-dimensional ARRAY/VARRAY type.

A1
ARRAY (multidimensional)

VARRAY (multidimensional)

You cannot use any of the predefined UDT data types as the base type for creating a distinct UDT, so you cannot create a domain using a distinct UDT based on a multidimensional ARRAY/VARRAY type.

AN
BINARY LARGE OBJECT (BLOB) BL(n)
BIGINT I8
BLOB BO
BYTE B(n)
BYTEINT I1
CHARACTER C(n)
CHARACTER VARYING CV(n)

CV(n) is the same as VC(n)

CLOB CO
CHARACTER LARGE OBJECT (CLOB) CL(n)
DATE D
DECIMAL DEC (n[,m])
DOUBLE PRECISION DP
FLOAT F(n)
GRAPHIC G(n)
INTEGER I
INTERVAL YEAR IY
INTERVAL YEAR TO MONTH IYM
INTERVAL MONTH IMO
INTERVAL DAY ID
INTERVAL DAY TO HOUR IDH
INTERVAL DAY TO MINUTE IDM
INTERVAL DAY TO SECOND IDS
INTERVAL HOUR IH
INTERVAL HOUR TO MINUTE IHM
INTERVAL HOUR TO SECOND IHS
INTERVAL MINUTE IMI
INTERVAL MINUTE TO SECOND IMS
INTERVAL SECOND IS
LONG CHARACTER VARYING LVC
LONG GRAPHIC VARYING LVG
NUMBER (both exact and approximate forms) N
NUMERIC NUM (n[,m])
PERIOD(DATE)

You cannot use any of the predefined Period data types as the base type for creating a distinct UDT, so you cannot create a domain using a distinct UDT based on a PERIOD type.

PD
PERIOD(TIME) PT
PERIOD(TIME WITH TIME ZONE) PTTZ
PERIOD(TIMESTAMP) PTS
PERIOD(TIMESTAMP <UNTIL_CHANGED>)

When the ending element value for PERIOD(TIMESTAMP) is UNTIL_CHANGED, the stored value for the ending element is only 1 byte; otherwise it is 10 bytes.

PTS_UC
PERIOD(TIMESTAMP WITH TIME ZONE)

When the ending element value for PERIOD(TIMESTAMP) WITH TIME ZONE is UNTIL_CHANGED, the stored value for the ending element is only 1 byte; otherwise, it is 12 bytes.

PTSTZ
PERIOD(TIMESTAMP WITH TIME ZONE <UNTIL_CHANGED>) PTSTZ_UC
PERIOD (with derived period columns) PP
REAL R
SMALLINT I2
TIME T
TIMESTAMP TS
TIME WITH TIME ZONE TTZ
TIMESTAMP WITH TIME ZONE TSTZ
VARBYTE VB(n)
VARCHAR VC(n)

VC(n) is the same as CV(n)

VARCHAR(n) CHARACTER SET GRAPHIC VG(n)
XML XML

You should develop your own data type codes for the UDTs your site uses.

Example: Single-Byte Character Set Definitions

This example assumes you are using a single-byte character set to define the Addr, City, and Comment domains.

Domains

Page: ___   of: ___

ELDM Page: ______

System: _________

Domain Name Domain Description Data Type Max Bytes Print Format Constraint Number
Addr Address CV(30) 30    
Amt Dollar Amount D(10,2) 8 $$$$$$$9.99  
City City Name CV(30) 30    
Comment Comment CV(100) 100    
... ... ... ... ... ...