17.10 - Example - 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)

The following CREATE TABLE statement defines a PERIOD(TIMESTAMP(3)) column with a default value specified using WITH DEFAULT. The WITH DEFAULT option sets the default value to a Period value constructor with the beginning argument set to CURRENT_TIMESTAMP(3) and the ending argument set to UNTIL_CHANGED.

CREATE TABLE t4
(
      employee_id         INTEGER,
      employee_name       CHARACTER(15),
      employee_duration   PERIOD(TIMESTAMP(3)) WITH DEFAULT
);