15.28 SORT_MEMBERS Procedure
Reorders 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 or 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 occurs.
Syntax
APEX_COLLECTION.SORT_MEMBERS (
p_collection_name IN VARCHAR2,
p_sort_on_column_number IN NUMBER )
Parameters
Parameter | Description |
---|---|
p_collection_name |
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. |
p_sort_on_column_number |
The column number used to sort the collection. The domain of possible values is 1 to 50. |
Example
In this example, column 2
of the DEPARTMENTS
collection is the department location. The collection is reordered according to the department location.
BEGIN
APEX_COLLECTION.SORT_MEMBERS (
p_collection_name => 'DEPARTMENTS',
p_sort_on_column_number => '2';
END;
Parent topic: APEX_COLLECTION