17.2 About Using Collections

Use collections to temporarily capture one or more nonscalar values. Collections enable you to store rows and columns currently in session state so they can be accessed, manipulated, or processed during a user's specific session.

Think of a collection as a bucket in which you temporarily store and name rows of information.

The following are examples of when you might use collections:

  • When you are creating a data-entry wizard in which multiple rows of information first need to be collected within a logical transaction. You can use collections to temporarily store the contents of the multiple rows of information, before performing the final step in the wizard when both the physical and logical transactions are completed.
  • When your application includes an update page on which a user updates multiple detail rows on one page. The user can make many updates, apply these updates to a collection and then call a final process to apply the changes to the database.
  • When you are building a wizard where you are collecting an arbitrary number of attributes. At the end of the wizard, the user then performs a task that takes the information temporarily stored in the collection and applies it to the database.

You insert, update, and delete collection information using the PL/SQL API APEX_COLLECTION.

See Also: