BEGIN
OPEN cur_case_name_search;
LOOP
FETCH cur_case_name_search INTO v_case_name_row;
EXIT WHEN cur_case_name_search%NOTFOUND
OR v_case_name_row.rank > v_matchingvalue
OR o_pid_rank_tab.count >=
ukcc_constants.c_casename_search_threshold
+ 1;
v_prev_score := v_case_name_row.sc;
IF Nvl (v_persistentid, '~') != v_case_name_row.persistentid THEN
IF Check_duplicates (v_case_name_row.persistentid, o_pid_rank_tab)
THEN
o_pid_rank_tab.extend;
O_pid_rank_tab (o_pid_rank_tab.count) :=
Ukcc_pid_score_type (
v_case_name_row.persistentid, v_case_name_row.sc);
END IF;
END IF;
END LOOP;
CLOSE cur_case_name_search;
END;