Prepare for collection data types

Before you can access and handle an individual element of a simple or nested collection, you must perform the following tasks:
  • Declare a collection variable to hold the collection.
  • Declare an element variable to hold an individual element of the collection.
  • Select the collection from the database into the collection variable.

After you take these initial steps, you can insert elements into the collection or select and handle elements that are already in the collection.

Each of these steps is explained in the following sections, using the numbers table as an example.
Tip: You can handle collections in any SPL routine.