Every collection contains a named list of data elements (or members) which can have up to 50 character attributes (
VARCHAR2(4000)), five number attributes, five date attributes, one XML Type attribute, one large binary attribute (
BLOB), and one large character attribute (
CLOB). You insert, update, and delete collection information using the PL/SQL API
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.
Beginning in Oracle Database 12c, database columns of data type
VARCHAR2 can be defined up to 32,767 bytes. This requires that the database initialization parameter
MAX_STRING_SIZE has a value of
EXTENDED. If Application Express was installed in Oracle Database 12c and with
EXTENDED, then the tables for the Application Express collections will be defined to support up 32,767 bytes for the character attributes of a collection. For the methods in the APEX_COLLECTION API, all references to character attributes (
c050) can support up to 32,767 bytes.