DB2 Scalar functions - MAX_CARDINALITY


Volta a página anterior

Volta ao Menu das scalar functions

Volta ao Menu Principal


Desenvolvido por DORNELLES Carlos Alberto - Analista de Sistemas - Brasília DF. - cad_cobol@hotmail.com

MAX_CARDINALITY

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.

MAX_CARDINALITY ( array-expression )

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

  1. Return the maximum cardinality of the RECENT_CALLS array variable of array type PHONENUMBERS:
       SET LIST_SIZE = MAX_CARDINALITY(RECENT_CALLS)
    The SQL variable LIST_SIZE is set to 50, which is the maximum cardinality that the array type PHONENUMBERS was defined with.


© Copyright IBM Corp.