Merging Collections

You can merge members of a collection with values passed in a set of arrays. By using the p_init_query argument, you can create a collection from the supplied query, for example:

APEX_COLLECTION.MERGE_MEMBERS
p_collection_name => collection_name

Note that if the collection exists, the following occurs:

Any attribute value exceeding 4,000 characters will be truncated to 4,000 characters. Table: Available Arguments for Merging Collections describes the available arguments you can use when merging collections.

Available Arguments for Merging Collections

Argument Description

p_c001

Array of first attribute values to be merged. Maximum length is 4,000 characters. If the maximum length is greater, it will be truncated to 4,000 characters.

The count of elements in the P_C001 PL/SQL table is used as the total number of items across all PL/SQL tables. For example, if P_C001.count = 2 and P_C002.count = 10, only 2 members will be merged. Note that if P_C001 is null, an application error will be raised.

p_c0xx

Attribute of XX attributes values to be merged. Maximum length is 4,000 characters. If the maximum length is greater, it will be truncated to 4,000 characters.

p_collection_name

Name of the collection.

See Also: "About Collection Naming"

p_null_index

Use this argument to identify rows the merge function should ignore. This argument identifies an row as null. Null rows are automatically removed from the collection.

p_null_value

Use this argument in conjunction with the p_null_index. Identifies the null value. If used this value cannot be null. A typical value for this argument is 0.

p_init_query

Use the query defined by this argument to create a collection if the collection does not exist.