Oracle PL/SQL - PL SQL Data Type Collection Methods

Introduction

A collection method is a PL/SQL a function or a procedure.

The following table summarizes the collection methods.

For a null collection, EXISTS does not raise the exception COLLECTION_IS_NULL.

MethodType Description
DELETEProcedure Deletes elements from collection.
TRIM Procedure Deletes elements from end of varray or nested table.
EXTENDProcedure Adds elements to end of varray or nested table.
EXISTSFunction Returns TRUE if and only if specified element of varray or nested table exists.
FIRST Function Returns first index in collection.
LAST Function Returns last index in collection.
COUNT Function Returns number of elements in collection.
LIMIT Function Returns maximum number of elements that collection can have.
PRIOR Function Returns index that precedes specified index.
NEXT Function Returns index that succeeds specified index.

The basic syntax of a collection method invocation is:

collection_name.method 

A collection method invocation can appear anywhere in PL/SQL statement, not in a SQL statement.