15.8 CREATE_COLLECTION Procedure

Creates an empty collection that does not already exist. If a collection exists with the same name for the current user in the same session for the current application ID, an application error occurs.

Syntax

APEX_COLLECTION.CREATE_COLLECTION (
    p_collection_name       IN VARCHAR2,
    p_truncate_if_exists    IN VARCHAR2 DEFAULT 'NO' )

Parameters

Parameter Description
p_collection_name The name of the collection. The maximum length is 255 characters. An error is returned if this collection exists with the specified name of the current user and in the same session.
p_truncate_if_exists If YES, then members of the collection are first truncated if the collection exists and no error occurs. If NO (or not YES), and the collection exists, an error occurs.

Example

This example creates an empty collection named EMPLOYEES.

BEGIN
    APEX_COLLECTION.CREATE_COLLECTION(
        p_collection_name => 'EMPLOYEES');
END;