Hitachi

Hitachi Advanced Database SQL Reference


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:

(3) Rules

  1. 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.

  2. 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

[Figure]