@@ -69,7 +69,10 @@ create or replace type body ut_compound_data_value as
6969 return l_result_string;
7070 end;
7171
72- overriding member function diff( a_other ut_data_value, a_exclude_xpath varchar2, a_include_xpath varchar2, a_join_by_xpath varchar2, a_unordered boolean := false ) return varchar2 is
72+ overriding member function diff(
73+ a_other ut_data_value, a_exclude_xpath varchar2, a_include_xpath varchar2,
74+ a_join_by_xpath varchar2, a_unordered boolean := false
75+ ) return varchar2 is
7376 l_result clob;
7477 l_result_string varchar2(32767);
7578 begin
@@ -80,8 +83,10 @@ create or replace type body ut_compound_data_value as
8083 end;
8184
8285 -- TODO : Rework to exclude xpath
83- member function get_data_diff(a_other ut_data_value, a_exclude_xpath varchar2, a_include_xpath varchar2,
84- a_join_by_xpath varchar2, a_unordered boolean) return clob is
86+ member function get_data_diff(
87+ a_other ut_data_value, a_exclude_xpath varchar2, a_include_xpath varchar2,
88+ a_join_by_xpath varchar2, a_unordered boolean
89+ ) return clob is
8590 c_max_rows integer := ut_utils.gc_diff_max_rows;
8691 l_result clob;
8792 l_results ut_utils.t_clob_tab := ut_utils.t_clob_tab();
@@ -191,8 +196,10 @@ create or replace type body ut_compound_data_value as
191196 return l_result;
192197 end;
193198
194- member function compare_implementation(a_other ut_data_value, a_unordered boolean, a_inclusion_compare boolean,
195- a_is_negated boolean, a_join_by_list ut_varchar2_list:=ut_varchar2_list()) return integer is
199+ member function compare_implementation(
200+ a_other ut_data_value, a_unordered boolean, a_inclusion_compare boolean,
201+ a_is_negated boolean, a_join_by_list ut_varchar2_list := ut_varchar2_list()
202+ ) return integer is
196203
197204 l_diff_id ut_compound_data_helper.t_hash;
198205 l_other ut_compound_data_value;
@@ -205,33 +212,35 @@ create or replace type body ut_compound_data_value as
205212 l_sql_rowcount integer :=0;
206213
207214 begin
208- l_other := treat(a_other as ut_compound_data_value);
209- l_diff_id := ut_compound_data_helper.get_hash(self.data_id||l_other.data_id);
210-
211- open l_loop_curs for ut_compound_data_helper.gen_compare_sql(a_inclusion_compare, a_is_negated, a_unordered,
212- treat(a_other as ut_data_value_refcursor), a_join_by_list ) using self.data_id,l_other.data_id;
213- loop
214- fetch l_loop_curs bulk collect into l_diff_tab limit l_max_rows;
215- exit when l_diff_tab.count = 0;
216- if (ut_utils.gc_diff_max_rows > l_sql_rowcount ) then
217- ut_compound_data_helper.insert_diffs_result(l_diff_tab,l_diff_id);
218- end if;
219- l_sql_rowcount := l_sql_rowcount + l_diff_tab.count;
220- if (ut_utils.gc_diff_max_rows <= l_sql_rowcount and l_max_rows != ut_utils.gc_bc_fetch_limit ) then
221- l_max_rows := ut_utils.gc_bc_fetch_limit;
222- end if;
223- end loop;
224-
225- ut_compound_data_helper.set_rows_diff(l_sql_rowcount);
226- --result is OK only if both are same
227- if l_sql_rowcount = 0 and ( self.elements_count = l_other.elements_count or a_inclusion_compare )then
228- l_result := 0;
229- else
230- l_result := 1;
231- end if;
215+ l_other := treat(a_other as ut_compound_data_value);
216+ l_diff_id := ut_compound_data_helper.get_hash(self.data_id||l_other.data_id);
217+
218+ open l_loop_curs for
219+ ut_compound_data_helper.gen_compare_sql(
220+ a_inclusion_compare, a_is_negated, a_unordered,
221+ treat(a_other as ut_data_value_refcursor), a_join_by_list
222+ ) using self.data_id,l_other.data_id;
223+ loop
224+ fetch l_loop_curs bulk collect into l_diff_tab limit l_max_rows;
225+ exit when l_diff_tab.count = 0;
226+ if (ut_utils.gc_diff_max_rows > l_sql_rowcount ) then
227+ ut_compound_data_helper.insert_diffs_result(l_diff_tab,l_diff_id);
228+ end if;
229+ l_sql_rowcount := l_sql_rowcount + l_diff_tab.count;
230+ if (ut_utils.gc_diff_max_rows <= l_sql_rowcount and l_max_rows != ut_utils.gc_bc_fetch_limit ) then
231+ l_max_rows := ut_utils.gc_bc_fetch_limit;
232+ end if;
233+ end loop;
232234
233- return l_result;
235+ ut_compound_data_helper.set_rows_diff(l_sql_rowcount);
236+ --result is OK only if both are same
237+ if l_sql_rowcount = 0 and ( self.elements_count = l_other.elements_count or a_inclusion_compare ) then
238+ l_result := 0;
239+ else
240+ l_result := 1;
241+ end if;
234242
243+ return l_result;
235244 end;
236245
237246end;
0 commit comments