我最终为其创建了一个自定义函数。这是代码:
CREATE OR REPLACE function match_clob(clob_1 clob, clob_2 clob) return number assimilar number := 0;sec_similar number := 0;sections number := 0;max_length number := 3949;length_1 number;length_2 number;vchar_1 varchar2 (3950);vchar_2 varchar2 (3950);begin length_1 := length(clob_1); length_2 := length(clob_2); --dbms_output.put_line('length_1: '||length_1); --dbms_output.put_line('length_2: '||length_2); IF length_1 > max_length or length_2 > max_length THEN FOR x IN 1 .. ceil(length_1 / max_length) LOOP --dbms_output.put_line('((x-1)*max_length) + 1'||(x-1)||' * '||max_length||' = '||(((x-1)*max_length) + 1)); vchar_1 := substr(clob_1, ((x-1)*max_length) + 1, max_length); vchar_2 := substr(clob_2, ((x-1)*max_length) + 1, max_length);-- dbms_output.put_line('Section '||sections||' vchar_1: '||vchar_1||' ==> vchar_2: '||vchar_2); sec_similar := UTL_MATCH.JARO_WINKLER_SIMILARITY(vchar_1, vchar_2); --dbms_output.put_line('sec_similar: '||sec_similar); similar := similar + sec_similar; sections := sections + 1; END LOOP; --dbms_output.put_line('Similar: '||similar||' ==> Sections: '||sections); similar := similar / sections; ELSE similar := UTL_MATCH.JARO_WINKLER_SIMILARITY(clob_1,clob_2); END IF; --dbms_output.put_line('Overall Similar: '||similar); return(similar);end;/


