16.20 - Examples - 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

Example: Returned Expression Errors for NULLIFZERO

The following expressions return an error if the value of x or expression is zero.

   6 / x
   6 / expression

On the other hand, the following expressions return null, which is not an error because there is no violation of the divide by zero rule.

   6 / NULLIFZERO(x)
   6 / NULLIFZERO(expression)

Example: Returned Request Errors for NULLIFZERO

The following request returns a null in the second column because the HCap field value for Newman is zero. In BTEQ (field mode) this appears as a ‘?’.

   SELECT empno, NULLIFZERO(hcap) 
   FROM employee 
   WHERE empno = 10019 ;