This Oracle tutorial explains how to use the Oracle/PLSQL CARDINALITY function with syntax and examples.
The Oracle/PLSQL CARDINALITY function returns the number of elements in a nested table.
The syntax for the CARDINALITY function in Oracle/PLSQL is:
The column in the nested table that you wish to return the cardinality for.
The CARDINALITY function returns a numeric value. 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.
The CARDINALITY function can be used in the following versions of Oracle/PLSQL:
Let's look at some Oracle CARDINALITY function examples and explore how to use the CARDINALITY function in Oracle/PLSQL.
For example: