Oracle Maestro online help
Prev | Return to chapter overview | Next |
Collections
Collection is an ordered group of elements, all of the same type (for example, the grades for a class of students). Each element has a unique subscript that determines its position in the collection. PL/SQL offers three kinds of collections: associative arrays, nested tables, and varrays (short for variable-size arrays). Nested tables extend the functionality of associative arrays (formerly called "PL/SQL tables" or "index-by tables").
Collections work like the arrays found in most third-generation programming languages. Collections can have only one dimension. Most collections are indexed by integers, although associative arrays can also be indexed by strings. To model multi-dimensional arrays, you can declare collections whose items are other collections.
Nested tables and varrays can store instances of an object type and, conversely, can be attributes of an object type. Collections can also be passed as parameters. You can use them to move columns of data into and out of database tables or between client-side applications and stored subprograms.
New collections are created within Create Collection Wizard. In order to run the wizard you should either
or
or
To create a new collection with the same properties as one of the existing collection has:
|
Collections can be edited within Collection Editor. In order to run the editor you should either
collection name for quick search);
or
|
To drop a collection:
or
and confirm dropping in the dialog window.
|