You can implement object-relational features such as abstract datatypes and object views in your applications. In this module, you will see how to use collectors—sets of elements that are treated as part of a single row.
The two types of collectors available are nested tables and varying arrays. This module explains the differences between these two types of collectors, as well as how to implement and manage them. Collectors make use of abstract datatypes. You should be familiar with the creation and implementation of abstract datatypes before attempting to use varying arrays and nested tables.
Varying Arrays
A varying array allows you to store repeating attributes of a record in a single row.For example, suppose Dora Talbot wants to track which of her tools were borrowed by which of her workers. You could model this in a relational database by creating a BORROWER table:
The primary key of the BORROWER table is the combination of the Name column and the Tool column. Thus, if a single worker borrowed three tools, the worker’s name would be repeated in each of the three records.Even though the worker's Name value does not change, it is repeated in each record because it is part of the primary key. Collectors such as varying arrays allow you to repeat only those column values that change, potentially saving storage space.
You can use collectors to accurately represent relationships between datatypes in your database objects.