16.20 - Error Conditions - 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

Using the DEFAULT function can result in an error when any of the following conditions are true:

  • The column name is omitted and Teradata Database cannot derive the column context
  • The DEFAULT function appears in a partitioning expression for defining PPIs
  • The column name is omitted and the DEFAULT function appears in an expression that does not support the DEFAULT function without a column name
  • The DEFAULT function appears in an expression for which the result type is incompatible

    For example, consider the following table definition:

       CREATE TABLE Parts_Table
          (Part_Code   INTEGER DEFAULT 9999
          ,Part_Name   CHAR(20)
       );

    The following statement results in an error because the result type of the DEFAULT function is not compatible with the column to which the result is being compared:

       SELECT * FROM Parts_Table WHERE Part_Name = DEFAULT(Part_Code);