Rules for Using a DEFAULT Function in a RESET WHEN Condition - Teradata Vantage

Teradata® VantageCloud Lake

Deployment
VantageCloud
Edition
Lake
Product
Teradata Vantage
Published
January 2023
Language
English (United States)
Last Update
2024-04-03
dita:mapPath
phg1621910019905.ditamap
dita:ditavalPath
pny1626732985837.ditaval
dita:id
phg1621910019905
The following rules apply to the use of the DEFAULT function as part of a RESET WHEN condition:
  • You can specify a DEFAULT function with a column name argument within a predicate. The system evaluates the DEFAULT function to the default value of the column specified as its argument. After evaluation, the DEFAULT function is treated like a literal in the predicate.
  • You can specify a DEFAULT function without a column name argument within a predicate only if there is one column specification and one DEFAULT function as the terms on each side of the comparison operator within the expression.
  • Following existing comparison rules, a condition with a DEFAULT function used with comparison operators other than IS [NOT] NULL is unknown if the DEFAULT function evaluates to null.

    A condition other than IS [NOT]NULL with a DEFAULT function compared to a null evaluates to unknown.

Clause Comparison Result
IS NULL TRUE if the default is null, otherwise FALSE.
IS NOT NULL FALSE if the default is null, otherwise TRUE.