Introduction to collections
A collection is an array like homogeneous single-dimensional structure, which holds a set of elements of similar data type. Each cell in a collection, and hence, each element, is uniquely identified by its position index or the subscript. The element or the value contained in a cell can be of a valid SQL data type or a user-defined type. There are three types of collections: associative array; nested table; and varray.
A collection can be bounded or unbounded on the basis of it's collection size. Bounded collections have a fixed number of elements, as in arrays. Unbounded collections can have any number of elements. Varrays are bounded collections while the associative arrays and nested tables are unbounded.
On the basis of persistence in the database, a collection can be either a persistent or non-persistent collection. A persistent or SQL collection can either be created in the Oracle Database schema or declared within the PL/SQL block. A PL/SQL or non...