Adsense Ad

Tuesday 9 May 2017

Oracle Forms: Add List Element

ADD_LIST_ELEMENT built-in

Description

Adds a single element to a list item.

Syntax

PROCEDURE ADD_LIST_ELEMENT (list_name VARCHAR2, list_index, NUMBER list_label VARCHAR2, list_value NUMBER);

PROCEDURE ADD_LIST_ELEMENT (list_id ITEM,

list_index VARCHAR2, list_label VARCHAR2, list_value NUMBER);

Built-in Type  unrestricted procedure

Enter Query Mode  yes

Parameters

list_id                                        Specifies the unique ID that Form Builder 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.

list_index                                  Specifies the list index value.  The list index is 1 based.

list_label                                  Specifies the VARCHAR2 string that you want displayed as the label of the

list element.

list_value                                  The actual list element value you intend to add to the list item.

ADD_LIST_ELEMENT restrictions
For a base table list with the List Style property set to Poplist or T-list, Form Builder does not allow you to add another values element when the block contains queried or changed records. Doing so causes an error. This situation can occur if you have previously used DELETE_LIST_ELEMENT or CLEAR_LIST to remove the other values element that was specified at design time by the Mapping of Other Values list item property setting.

Note: The block status is QUERY when a block contains queried records. The block status is CHANGED when a block contains records that have been either inserted or updated.

ADD_LIST_ELEMENT examples
/*

**    Built-in:  ADD_LIST_ELEMENT
**    Example:  Deletes index value 1 and adds the value "1994" to
**                   the list item called years when a button is
pressed.
**    trigger:  When-Button-Pressed
*/
BEGIN 
Delete_List_Element(’years’,1);
Add_List_Element(’years’, 1, ’1994’, ’1994’); 
END;

No comments: