CARDINALITY Function | Data Types and Literals | Teradata Vantage - CARDINALITY - Advanced SQL Engine - Teradata Database

SQL Data Types and Literals

Product
Advanced SQL Engine
Teradata Database
Release Number
17.05
17.00
Published
June 2020
Language
English (United States)
Last Update
2021-01-22
dita:mapPath
zsn1556242031050.ditamap
dita:ditavalPath
lze1555437562152.ditaval
dita:id
B035-1143
lifecycle
previous
Product Category
Teradata Vantageā„¢

Returns an integer representing the number of elements in an ARRAY data type that currently have assigned values, or the number of elements that are initialized within a specific scope reference.

Syntax

System Function
CARDINALITY ( array_expr [, scope_reference ] )
Method-Style
array_expr.CARDINALITY ( [ scope_reference ] )
array_expr
An ARRAY expression, which is one of the following:
  • A reference to an ARRAY column
  • An ARRAY constructor expression
  • A UDF expression
  • A UDM expression
scope_reference

An ARRAY scope reference.

An explicit scope that includes uninitialized elements is acceptable input when an ARRAY expression is specified in a CARDINALITY function.