17.10 - Error Conditions - Advanced SQL Engine - Teradata Database

Teradata Vantageā„¢ - SQL Functions, Expressions, and Predicates

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

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

  • The column name is omitted and Vantage 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);