21.20 GET_POSITION_IN_LIST Function

This function returns the position in the list where p_value is stored. If it is not found, null is returned.

Syntax

APEX_PLUGIN_UTIL.GET_POSITION_IN_LIST(
    p_list IN apex_application_global.vc_arr2,
    p_value IN VARCHAR2)
RETURN NUMBER;

Parameters

Table 21-27 GET_POSITION_IN_LIST Parameters

Parameter Description

p_list

Array of type apex_application_global.vc_arr2 that contains entries of type VARCHAR2.

p_value

Value located in the p_list array.

Return

Table 21-28 GET_POSITION_IN_LIST Return

Return Description

NUMBER

Returns the position of p_value in the array p_list. If it is not found NULL is returned.

Example

The following example searchs for "New York" in the provided list and returns 2 into l_position.

declare
    l_list     apex_application_global.vc_arr2;
    l_position number;
begin
    l_list(1) := 'Rome';
    l_list(2) := 'New York';
    l_list(3) := 'Vienna';
    
    l_position := apex_plugin_util.get_position_in_list (
                      p_list  => l_list,
                      p_value => 'New York' );
end;