DELETE_LIST_ELEMENT Built-in
Description
Deletes a specific list element from a list item.
Syntax
PROCEDURE DELETE_LIST_ELEMENT
(list_name VARCHAR2,
list_index NUMBER);
PROCEDURE DELETE_LIST_ELEMENT
(list_id, ITEM
list_index NUMBER);
Built-in Type unrestricted procedure
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.
-
- list_index
-
- Specifies the list index value. The list index is 1 based.
Usage Notes
- Do not use the DELETE_LIST_ELEMENT Built-in if the Mapping of Other Values
property is defined and there are queried records in the block. Doing so may
cause Oracle Forms to be unable to display records that have already been
fetched.
For example, assume that a list item contains the values A, B, and C and the
Mapping of Other Values property is defined. Assume also that these values
have been fetched from the database (a query is open). At this point, if you
delete B from the list using DELETE_LIST_ELEMENT, an error will occur because
Oracle Forms will attempt to display the previously fetched values (A,
B, and C), but will be unable to because B was deleted from the list.
- Before deleting a list element, close any open queries. Use the ABORT_QUERY
Built-in to close an open query.
Note: A list does not contain an other values element if
none was specified at design time or if it was programmatically deleted from
the list at runtime.
DELETE_LIST_ELEMENT Restrictions
For a Poplist or T-list-style list item, Oracle Forms returns error FRM-41331: Could not delete element from <list_item> if you attempt to delete the default value element.
The default value element is the element whose label or value was specified at design time for the Initial Value property setting.
For a Combobox list item, you can delete the default value element only if the Initial Value property was set to an actual value, rather than an element label.
For a base table Poplist or T-list list item, Oracle Forms returns error FRM-41331: Could not delete element from <list_item> if you:
- attempt to delete the other values element when the block contains queried
or changed records.
- attempt to delete any element from a list that does not contain an other
values element when the block contains queried or changed records.
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 (queried records have been modified).
DELETE_LIST_ELEMENT Examples
/*
** Built-in: DELETE_LIST_ELEMENT
** Example: See ADD_LIST_ELEMENT
*/