Error Conditions - Analytics Database - Teradata Vantage

SQL Functions, Expressions, and Predicates

Deployment
VantageCloud
VantageCore
Edition
Enterprise
IntelliFlex
VMware
Product
Analytics Database
Teradata Vantage
Release Number
17.20
Published
June 2022
Language
English (United States)
Last Update
2024-01-12
dita:mapPath
obm1628111499646.ditamap
dita:ditavalPath
qkf1628213546010.ditaval
dita:id
kby1472250656485
lifecycle
latest
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);