Error Conditions - Advanced SQL Engine - Teradata Database

SQL Functions, Expressions, and Predicates

Product
Advanced SQL Engine
Teradata Database
Release Number
17.10
Published
July 2021
Language
English (United States)
Last Update
2021-07-28
dita:mapPath
SQL_Functions__Expressions__and_Predicates.Upload_071421/djk1612415574830.ditamap
dita:ditavalPath
SQL_Functions__Expressions__and_Predicates.Upload_071421/wrg1590696035526.ditaval
dita:id
B035-1145
lifecycle
previous
Product Category
Teradata Vantageā„¢

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);