Hi,
I am writing a process to plug into an existing infrstructure. I have an associative array of data (which I cannot change the definition of) that is defined as:
type vc_arr2 is table of varchar2(32767) index by binary_integer;
An example set of data might be:
Key Text
1 => Apple
2 => Banana
3 => Pear
4 => Plum
5 => Grape
etc etc
Now I need to be able to see whethe a particular text value appears in the values, ie "Is 'Banana' in the array?". Now obviously I could do this by writing a procedure to loop over all the elements sequentially however is there something built in to do this? There is the obvious the overhead of (potentially) looping through every element for each item I am searching for - I am hoping there is something built in which in more efficient (ie, "indexes" values or something like that).
As far as I am aware, ARRAY.EXISTS() works on the key and not the value, and MEMBER OF cannot be used with associative arrays.
I am not interested in what the key is for a given value (and I realise there might be more than one key mapping to a given value), all I am interested in is just whether the item exists in the array.
Any help or sugestions would be greatly appreciated!