Skip to content

ARRAY_MAX_CARDINALITY

DECLARE
TYPE t_numbers IS TABLE OF NUMBER
LIMIT 5;
BEGIN
DBMS_OUTPUT.PUT_LINE('Maximum number of elements: ' || t_numbers.LIMIT);
END;
Maximum number of elements: 5

The ARRAY_MAX_CARDINALITY attribute is used to limit the size of a collection. In the example, a PL/SQL block declares a type t_numbers as a table of numbers, limiting its size to 5 elements. The named block then outputs the limit of the collection, which shows as “5”.