15.4 ADD_MEMBERS Procedure

Adds an array of members to a collection. An error occurs if the specified collection does not exist for the current user in the same session for the current application ID.

Gaps are not used when adding a new member, so an existing collection with members of sequence IDs (1,2,5,8) adds the new member with a sequence ID of 9.

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 is 2 and p_c002.count is 10, only 2 members are added. If p_c001 is NULL, an application error occurs.

Syntax

APEX_COLLECTION.ADD_MEMBERS (
  p_collection_name IN VARCHAR2,
  p_c001            IN apex_application_global.vc_arr2,
  p_c002            IN apex_application_global.vc_arr2  DEFAULT empty_vc_arr,
  p_c003            IN apex_application_global.vc_arr2  DEFAULT empty_vc_arr,
  ...
  p_c050            IN apex_application_global.vc_arr2  DEFAULT empty_vc_arr,
  p_n001            IN apex_application_global.n_arr    DEFAULT empty_n_arr,
  p_n002            IN apex_application_global.n_arr    DEFAULT empty_n_arr,
  p_n003            IN apex_application_global.n_arr    DEFAULT empty_n_arr,
  p_n004            IN apex_application_global.n_arr    DEFAULT empty_n_arr,
  p_n005            IN apex_application_global.n_arr    DEFAULT empty_n_arr,
  p_d001            IN apex_application_global.d_arr    DEFAULT empty_d_arr,
  p_d002            IN apex_application_global.d_arr    DEFAULT empty_d_arr,
  p_d003            IN apex_application_global.d_arr    DEFAULT empty_d_arr,
  p_d004            IN apex_application_global.d_arr    DEFAULT empty_d_arr,
  p_d005            IN apex_application_global.d_arr    DEFAULT empty_d_arr,
  p_generate_md5    IN VARCHAR2                         DEFAULT 'NO' )

Parameters

Note:

Any character attribute exceeding 4,000 characters is truncated to 4,000 characters. The number of members added is based on the number of elements in the first array.

Parameter Description
p_collection_name The name of an existing collection. Maximum length is 255 bytes. Collection names are not case sensitive and are converted to upper case.
p_c001 through p_c050 Array of character attribute values to be added.
p_n001 through p_n005 Array of numeric attribute values to be added.
p_d001 through p_d005 Array of date attribute values to be added.
p_generate_md5 Valid values include YES and NO. YES to specify if the message digest of the data of the collection member should be computed. Use this parameter to compare the MD5 of the collection member with another member or to see if that member has changed.

Example

The following example adds two new members to the EMPLOYEE table.

BEGIN
    APEX_COLLECTION.ADD_MEMBERS(
        p_collection_name => 'EMPLOYEE',
        p_c001 => l_arr1,
        p_c002 => 1_arr2);
END;