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.