| Oracle® Database PL/SQL Language Reference 11g Release 2 (11.2) Part Number E10472-05 |
|
|
View PDF |
A collection method is a built-in PL/SQL subprogram that returns information about a collection or operates on a collection.
Topics:
Syntax
collection_method_call ::=

Semantics
collection_name
The name of a collection.
COUNT
A function that returns the current number of elements in the collection, described in "COUNT Method".
DELETE
A procedure that deletes elements from the collection, described in "DELETE Method".
Restriction on DELETE If collection_name identifies a varray, you cannot specify indexes with DELETE.
index
A numeric expression whose value has data type PLS_INTEGER or a data type that can be implicitly converted to PLS_INTEGER (see Table 3-10, "Possible Implicit PL/SQL Data Type Conversions").
EXISTS
A function that returns TRUE if the indexth element of the collection exists and FALSE otherwise. For more information, see "EXISTS Method".
Restriction on EXISTS You cannot use EXISTS if collection_name identifies an associative array.
EXTEND
A procedure that increases the size of the collection, described in "EXTEND Method".
Restriction on EXTEND You cannot use EXTEND if collection_name identifies an associative array.
FIRST
A function that returns the first subscript or key value in the collection, described in "FIRST and LAST Methods".
LAST
A function that returns the last subscript or key value in the collection, described in "FIRST and LAST Methods".
LIMIT
A function that returns the maximum number of elements that the collection can have. If the collection has no maximum size, LIMIT returns NULL. (For an example, see "LIMIT Method".
NEXT
A function that returns the subscript that succeeds index n. If n has no successor, NEXT(n) returns NULL. For more information, see "PRIOR and NEXT Methods".
PRIOR
A function that returns the subscript that precedes index n in a collection. If n has no predecessor, PRIOR(n) returns NULL. For more information, see "PRIOR and NEXT Methods".
TRIM
A procedure that deletes elements from the end of a collection, described in "TRIM Method".
Restriction on TRIM You cannot use TRIM if collection_name identifies an associative array.
number
The number of elements to delete from the end of a collection. The default is one.
Examples
Example 5-28, "Checking Whether a Collection Element EXISTS"
Example 5-30, "Checking the Maximum Size of a Collection with LIMIT"
Related Topics
In this chapter:
In other chapters: