Oracle System Function - Oracle/PLSQL CARDINALITY Function






This Oracle tutorial explains how to use the Oracle/PLSQL CARDINALITY function.

The Oracle/PLSQL CARDINALITY function returns the number of elements in a nested table.

Syntax

The syntax for the Oracle/PLSQL CARDINALITY function is:

CARDINALITY( nestedTableColumn )

nestedTableColumn is the column in the nested table.

If the nested table is empty, the CARDINALITY function will return NULL.

If the nested table is a null collection, the CARDINALITY function will return NULL.

Example

select id, CARDINALITY(location)
 from emp;