|
Re: Getting the list index of the selected list element : Very Urgent [message #78264 is a reply to message #78263] |
Wed, 06 February 2002 06:12 |
Srinivas Konda
Messages: 29 Registered: October 2001
|
Junior Member |
|
|
There is no built-in to get the list index. You need to write your own logic. Here is one you can use.
USAGE:
v := get_list_index(:system.cursor_value, 'LIST1');
-- V is a variable, returned by the function GET_LIST_INDEX, Use the VARIABLE V to delete from your list or what ever.
DELETE_LIST_ELEMENT('LIST1', v );
Function :
FUNCTION get_list_index(compareval IN VARCHAR, list_name IN VARCHAR2) RETURN NUMBER IS
listcount NUMBER(10);
BEGIN
listcount := GET_LIST_ELEMENT_COUNT(list_name);
FOR i IN 1..listcount LOOP
IF UPPER(compareval) = UPPER(GET_LIST_ELEMENT_VALUE(list_name, i)) THEN
RETURN i;
END IF;
END LOOP;
RETURN -1;
END;
|
|
|