17.10 - Examples - Advanced SQL Engine - Teradata Database

Teradata Vantageā„¢ - Data Types and Literals

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

Example: WITH DEFAULT Phrase

If the EdLev column is defined as:

EdLev BYTEINT FORMAT 'Z9' NOT NULL WITH DEFAULT,

then the column definition for EdLev is stored as:

EdLev BYTEINT NOT NULL DEFAULT 0 FORMAT 'Z9',

Example: Inserting a Row Using a Default Value

The following INSERT statement adds a row containing a zero in the EdLev field defined in the previous example:

INSERT INTO Employee
 (Name, EmpNo, DeptNo, DOB, Sex, EdLev)
 VALUES ('Newhire A', 10025, 700, '49/10/17', 'M',) ;

Example: TIME Column With a Default of the Current Time

The following example shows a TIME column specified with a default of the current time:

Stage TIME(3) WITH DEFAULT

Example: INTERVAL Column With a Default Interval

The following example shows an INTERVAL column specified with a default interval:

Scale INTERVAL HOUR(2) WITH DEFAULT