If you make the numbers the index of a PL/SQL table, then you can simply check whether they exist using the .exists operator e.g.
declare
type t_array is table of varchar2(1) index by binary_integer;
type t_lookup is varray(5) of number;
v_array t_array;
v_lookup t_lookup := t_lookup(1,3,5);
begin
v_array(1) := 'x';
v_array(2) := 'x';
v_array(3) := 'x';
v_array(8) := 'x';
v_array(10) := 'x';
for i in v_lookup.first..v_lookup.last loop
if v_array.exists(v_lookup(i)) then
dbms_output.put_line('Found '||v_lookup(i));
else
dbms_Output.put_line('Did not find '||v_lookup(i));
end if;
end loop;
end;
[Updated on: Mon, 30 October 2006 07:48]
Report message to a moderator