Previous
Previous
 
Next
Next


Naming, Creating and Accessing Collections

Topics:

Naming Collections

When you create a collection, you must give it a name that cannot exceed 255 characters. Note that collection names are not case-sensitive and will be converted to uppercase.

Once the collection is named, you can access the values in the collection by running a SQL query against the view APEX_COLLECTIONS.


See Also:

"Accessing a Collection", "CREATE_COLLECTION Procedure Parameters", "CREATE_OR_TRUNCATE_COLLECTION Procedure Parameters"

Creating a Collection

Every collection contains a named list of data elements (or members) which can have up to 50 character attributes (VARCHAR2(4000)), five number attributes, one XML Type attribute, one large binary attribute (BLOB), and one large character attribute (CLOB). You use the following methods to create a collection:


See Also:

"CREATE_COLLECTION Procedure", "CREATE_OR_TRUNCATE_COLLECTION Procedure", "CREATE_COLLECTION_FROM_QUERY Procedure", "CREATE_COLLECTION_FROM_QUERY2 Procedure", "CREATE_COLLECTION_FROM_QUERY_B Procedure", "CREATE_COLLECTION_FROM_QUERYB2 Procedure"

About the Parameter p_generate_md5

Use the p_generate_md5 flag to specify if the message digest of the data of the collection member should be computed. By default, this flag is set to NO. Use this parameter to check the MD5 of the collection member (that is, compare it with another member or see if a member has changed).


See Also:

"Determining Collection Status" for information about using the GET_MEMBER_MD5 function, "GET_MEMBER_MD5 Function"

Accessing a Collection

You can access the members of a collection by querying the database view APEX_COLLECTIONS. The APEX_COLLECTIONS view has the following definition:

COLLECTION_NAME   NOT NULL VARCHAR2(255)
SEQ_ID            NOT NULL NUMBER 
C001              VARCHAR2(4000)
C002              VARCHAR2(4000)
C003              VARCHAR2(4000)   
C004              VARCHAR2(4000)   
C005              VARCHAR2(4000)  
...
C050              VARCHAR2(4000)
N001              NUMBER
N002              NUMBER
N003              NUMBER
N004              NUMBER
N005              NUMBER     
CLOB001           CLOB
BLOB001           BLOB  
XMLTYPE001        XMLTYPE
MD5_ORIGINAL      VARCHAR2(4000)  

Use the APEX_COLLECTIONS view in an application just as you would use any other table or view in an application, for example:

SELECT c001, c002, c003, n001, clob001
   FROM APEX_collections
 WHERE collection_name = 'DEPARTMENTS'