DEFAULT Phrase Examples - Teradata Vantage

Teradata® VantageCloud Lake

Deployment
VantageCloud
Edition
Lake
Product
Teradata Vantage
Published
January 2023
Language
English (United States)
Last Update
2024-04-03
dita:mapPath
phg1621910019905.ditamap
dita:ditavalPath
pny1626732985837.ditaval
dita:id
phg1621910019905

Example: Numeric

Suppose the DeptNo column is defined in table Departments as follows.

CREATE TABLE Departments
   (DeptName CHARACTER(36)
   ,DeptNo SMALLINT DEFAULT 100 FORMAT '999' BETWEEN 100 AND 900
   ,ManagerID INTEGER);

When the value for the DeptNo field is not provided in an INSERT statement, then the value 100 with type SMALLINT is inserted automatically.

Example: Date Literal

The following example shows a DATE column specified with a DEFAULT date literal:

F4 DATE DEFAULT DATE '2000-01-01'

Example: Current Time

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

Stage TIME(3) DEFAULT CURRENT_TIME(3)

Example: Interval

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

Scale INTERVAL YEAR(2) DEFAULT INTERVAL -'10' YEAR