16.20 - Result Value - Advanced SQL Engine - Teradata Database

Teradata Vantage™ - SQL Functions, Expressions, and Predicates

Product
Advanced SQL Engine
Teradata Database
Release Number
16.20
Published
March 2019
Language
English (United States)
Last Update
2020-03-25
dita:mapPath
xzf1512079057909.ditamap
dita:ditavalPath
TD_DBS_16_20_Update1.ditaval
dita:id
kby1472250656485

The DEFAULT function returns the default value of the specified column or derived column (if the column name is omitted).

If the specified or derived column is a view column or derived table column, the DEFAULT function returns the default value of the underlying table column.

If the default value of a column evaluates to a system variable, for example when the default value is CURRENT_TIME or USER, the DEFAULT function returns the value of the system variable at the time the statement is executed.

DEFAULT returns null when any of the following conditions are true:

  • The specified or derived column was defined with a DEFAULT NULL phrase
  • The specified or derived column has no explicit default value
  • The data type of the specified or derived column is UDT
  • The specified or derived column is the name of a view column that is derived from a single underlying table column that has no explicit default value

    For an example, see “Example: Specifying a View Column Name”.

  • The specified or derived column is the name of a view column that is not derived from a single underlying table column, for example, the view column is derived from a literal expression