Previous
Previous
 
Next
Next


Adding, Updating and Deleting Collection Members

Topics:

Adding Members to a Collection

When data elements (or members) are added to a collection, they are assigned a unique sequence ID. As you add members to a collection, the sequence ID will change in increments of 1, with the newest members having the largest ID.

You add new members to a collection using the ADD_MEMBER function. Calling this function returns the sequence ID of the newly added member.

You can also add new members (or an array of members) to a collection using the ADD_MEMBERS procedure. The number of members added is based on the number of elements in the first array.


See Also:

"ADD_MEMBER Procedure", "ADD_MEMBER Function", "ADD_MEMBERS Procedure"

About the Parameters p_generate_md5, p_clob001, p_blob001, and p_xmltype001

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).

Use p_clob001 for collection member attributes which exceed 4,000 characters. Use p_blob001 for binary collection member attributes. Use p_xmltype001 to store well-formed XML.


See Also:

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

Updating Collection Members

You can update collection members by calling the UPDATE_MEMBER procedure and referencing the desired collection member by its sequence ID. The UPDATE_MEMBER procedure replaces an entire collection member, not individual member attributes.

Use the p_clob001 parameter for collection member attributes which exceed 4,000 characters.

To update a single attribute of a collection member, use the UPDATE_MEMBER_ATTRIBUTE procedure.


See Also:

"UPDATE_MEMBER Procedure", "UPDATE_MEMBERS Procedure", "UPDATE_MEMBER_ATTRIBUTE Procedure Signature 1", "UPDATE_MEMBER_ATTRIBUTE Procedure Signature 2", "UPDATE_MEMBER_ATTRIBUTE Procedure Signature 3", "UPDATE_MEMBER_ATTRIBUTE Procedure Signature 4", "UPDATE_MEMBER_ATTRIBUTE Procedure Signature 5"

Deleting Collection Members

You can delete a collection member by calling the DELETE_MEMBER procedure and referencing the desired collection member by its sequence ID. Note that this procedure leaves a gap in the sequence IDs in the specified collection.

You can also delete all members from a collection by when an attribute matches a specific value. Note that the DELETE_MEMBERS procedure also leaves a gap in the sequence IDs in the specified collection. If the supplied attribute value is null, then all members of the named collection will be deleted where the attribute (specified by p_attr_number) is null.


See Also:

"DELETE_MEMBER Procedure", "DELETE_MEMBERS Procedure"