Previous |
Next |
Topics:
Use COLLECTION_MEMBER_COUNT
to return the total count of all members in a collection. Note that this count does not indicate the highest sequence in the collection.
Use RESEQUENCE_COLLECTION
to resequence a collection to remove any gaps in sequence IDs while maintaining the same element order.
Use COLLECTION_EXISTS
to determine if a collection exists.
You can adjust the sequence ID of a specific member within a collection by moving the ID up or down. When you adjust a sequence ID, the specified ID is exchanged with another ID. For example, if you were to move the ID 2 up, 2 becomes 3, and 3 would become 2.
Use MOVE_MEMBER_UP
to adjust a member sequence ID up by one. Alternately, use MOVE_MEMBER_DOWN
to adjust a member sequence ID down by one.
Use the SORT_MEMBERS
method to reorder members of a collection by the column number. This method sorts the collection by a particular column number and also reassigns the sequence IDs for each member to remove gaps.
Clearing the session state of a collection removes the collection members. A shopping cart is a good example of when you might need to clear collection session state. When a user requests to empty the shopping cart and start again, you must clear the session state for a collection. You can remove session state of a collection by calling the TRUNCATE_COLLECTION
method or by using f?p
syntax.
Calling the TRUNCATE_COLLECTION
method deletes the existing collection and then recreates it, for example:
APEX_COLLECTION.TRUNCATE_COLLECTION( p_collection_name => collection name);
You can also use the sixth f?p
syntax argument to clear session state, for example:
f?p=App:Page:Session::NO:collection name
The p_generate_md5
parameter determines if the MD5 message digests are computed for each member of a collection. The collection status flag is set to FALSE
immediately after you create a collection. If any operations are performed on the collection (such as add, update, truncate, and so on), this flag is set to TRUE
.
You can reset this flag manually by calling RESET_COLLECTION_CHANGED
.
Once this flag has been reset, you can determine if a collection has changed by calling COLLECTION_HAS_CHANGED
.
When you add a new member to a collection, an MD5 message digest is computed against all 50 attributes and the CLOB attribute if the p_generated_md5
parameter is set to YES
. You can access this value from the MD5_ORIGINAL
column of the view APEX_COLLECTION
. You can access the MD5 message digest for the current value of a specified collection member by using the function GET_MEMBER_MD5
.