create or replace procedure cnav_list_intersection ( p_result OUT long, p_list1 IN long, p_list2 IN long ) IS listValue varchar2(2000); reststr long; countit number; BEGIN if (p_list1 is null or p_list2 is null) then p_result := null; return; end if; p_result:=null; countit :=0; listValue:=listfirst(p_list1,','); reststr:=listrest(p_list1,','); while (listValue is not null) loop listValue:=listfirst(reststr,','); reststr:=listrest(reststr,','); if (listValue is not null) then if ( ListFind(listValue,p_list2,',') = 1) then countit := countit +1; if (countit!=1) then p_result := p_result || ','; end if; p_result := p_result || listValue; end if; end if; end loop; END cnav_list_intersection; / show errors;