8.12.1 ARRAY_MAX_CARDINALITY
Returns the maximum number of elements in the array data specified for the target data.
- Organization of this subsection
(1) Specification format
scalar-function-ARRAY_MAX_CARDINALITY::= ARRAY_MAX_CARDINALITY(target-data) target-data::= value-expression
(2) Explanation of specification format
- target-data:
-
Specifies the array data determining the maximum number of elements
Note the following rules:
-
Specify the target data in the form of a value expression. For details about value expressions, see 7.21 Value expression.
-
Specify array data for the target data. For details about array data, see (7) Array data in 6.2.1 List of data types.
-
You cannot specify a dynamic parameter by itself for the target data.
-
(3) Rules
-
The data type of the execution result is the BIGINT type#.
- #
-
If the integer data type format is a legacy format, it will be an INTEGER type.
-
The NOT NULL constraint does not apply to the value of the execution result (the null value is allowed). However, the value of the maximum number of elements is always returned, so the value of the execution result will never be a null value.
(4) Examples
- Examples
-
Determine the maximum number of elements in each column (C1,C2,C3) of array type in table T1.
SELECT ARRAY_MAX_CARDINALITY("C1"), ARRAY_MAX_CARDINALITY("C2"), ARRAY_MAX_CARDINALITY("C3") FROM "T1" LIMIT 1