A script-enabled browser is required for this page to function properly.

GET_LIST_ELEMENT_COUNT Built-in

Description

Returns the total number of list item elements in a list, including elements with NULL values.

Syntax

FUNCTION GET_LIST_ELEMENT_COUNT
(list_id Item);

FUNCTION GET_LIST_ELEMENT_COUNT
(list_name VARCHAR2);

Built-in Type unrestricted function

Returns VARCHAR2

Enter Query Mode yes

Parameters

list_id 
 
Specifies the unique ID that Oracle Forms assigns when it creates the list item. Use the FIND_ITEM Built-in to return the ID to an appropriately typed variable. The data type of the ID is ITEM.
 
list_name 
 
The name you gave to the list item when you created it. The data type of the name is VARCHAR2.

GET_LIST_ELEMENT_COUNT Examples

/*

** Built-in: GET_LIST_ELEMENT_COUNT
** Example: Add an element to the list item. Before adding
** the element, verify that the element is not in
** the current list.
*/
DECLARE
total_list_count NUMBER(2);
list_id VARCHAR2(50);

loop_index_var NUMBER(2) := 1;
list_element VARCHAR2(50);
list_element_value VARCHAR2(50);
list_element_to_add VARCHAR2(50);
list_value_to_add VARCHAR2(50);
element_match VARCHAR2(5) := 'TRUE';
value_match VARCHAR2(5) := 'TRUE';
BEGIN
/*
** Determine the total number of list elements.
*/
total_list_count := Get_List_Element_Count(list_id);
/*
** Compare the current list item elements with the element that
** will be added.
*/
LOOP
list_element := Get_List_Element_Label(list_id,
loop_index_var);
loop_index_var := loop_index_var + 1;
IF list_element_to_add = list_element THEN
element_match := 'FALSE';
END IF;
EXIT WHEN list_element = list_element_to_add OR
loop_index_var = total_list_count;
END LOOP;
/*
** Compare the current list item values with the value that
** will be added.
*/
loop_index_var := 1;
LOOP
list_element_value:= Get_List_Element_Value(list_id,
loop_index_var);
loop_index_var := loop_index_var + 1;
IF list_value_to_add = list_element_value THEN
value_match := 'FALSE';
END IF;
EXIT WHEN list_element_value = list_value_to_add OR
loop_index_var = total_list_count;
END LOOP;
/*
** Add the element and value if it is not in the current list
*/
IF element_match AND value_match = 'TRUE' THEN
Add_List_Element(list_id, list_index, list_element_to_add,
list_value_to_add);
END IF
END;