(ARRAY_) MAX_CARDINALITY scalar function
The MAX_CARDINALITY function returns a value of type BIGINT representing the maximum number of elements that an array can contain. This is the cardinality that was specified in the CREATE TYPE statement for the ordinary array type. The ARRAY_MAX_CARDINALITY function is a synonym for the MAX_CARDINALITY scalar function.
The schema is SYSIBM.
-
array-expression
- An SQL variable, SQL parameter, or global variable of an array type, or a CAST specification of a parameter marker to an array type.
Result
The result can be null; if the argument is an associative array, the result is the null value.
Example
- Return the maximum cardinality of the
RECENT_CALLSarray variable of array typePHONENUMBERS:
The SQL variableSET LIST_SIZE = MAX_CARDINALITY(RECENT_CALLS)LIST_SIZEis set to 50, which is the maximum cardinality that the array typePHONENUMBERSwas defined with.
