Use this procedure to reorder the members of a given collection by the column number specified by p_sort_on_column_number. This sorts the collection by a particular column/attribute in the collection and reassigns the sequence IDs of each number such that no gaps exist. If a collection does not exist with the specified name for the current user in the same session and for the current Application ID, an application error is raised.
APEX_COLLECTION.SORT_MEMBERS ( p_collection_name IN VARCHAR2, p_sort_on_column_number IN NUMBER);
Table 5-24 SORT_MEMBERS Parameters
The name of the collection to sort. An error is returned if this collection does not exist with the specified name of the current user and in the same session.
The column number used to sort the collection. The domain of possible values is 1 to 50.
In this example, column 2 of the
DEPARTMENTS collection is the department location. The collection is reorder according to the department location.
BEGIN; APEX_COLLECTION.SORT_MEMBERS ( p_collection_name => 'DEPARTMENTS', p_sort_on_column_number => '2'; END;