@@ -91,6 +91,8 @@ create or replace package body ut_compound_data_helper is
9191 || case when a_order_enforced then ',
9292 row_number() over(partition by case when a.act_col_pos + e.exp_col_pos is not null then 1 end order by a.act_col_pos) a_pos_nn,
9393 row_number() over(partition by case when a.act_col_pos + e.exp_col_pos is not null then 1 end order by e.exp_col_pos) e_pos_nn'
94+ else
95+ null
9496 end ||q'[
9597 from expected_cols e
9698 full outer join actual_cols a
@@ -112,6 +114,8 @@ create or replace package body ut_compound_data_helper is
112114 || case when a_order_enforced then q'[
113115 --column position is not matching (both when excluded extra/missing columns as well as when they are included)
114116 or (a_pos_nn != e_pos_nn and exp_col_pos != act_col_pos)]'
117+ else
118+ null
115119 end ||q'[
116120 order by exp_col_pos, act_col_pos]'
117121 bulk collect into l_results using a_expected, a_actual;
@@ -312,7 +316,6 @@ create or replace package body ut_compound_data_helper is
312316 l_xmltable_stmt clob;
313317 l_select_stmt clob;
314318 l_partition_stmt clob;
315- l_equal_stmt clob;
316319 l_join_on_stmt clob;
317320 l_not_equal_stmt clob;
318321 l_where_stmt clob;
@@ -356,10 +359,8 @@ create or replace package body ut_compound_data_helper is
356359 l_compare_sql := replace(l_compare_sql,'{:join_type:}',get_join_type(a_inclusion_type,a_is_negated));
357360 l_compare_sql := replace(l_compare_sql,'{:join_condition:}',l_join_on_stmt);
358361
359- if l_not_equal_stmt is not null then
360- if (a_join_by_list.count > 0 and not a_is_negated) or (not a_unordered) then
362+ if l_not_equal_stmt is not null and ((a_join_by_list.count > 0 and not a_is_negated) or (not a_unordered)) then
361363 ut_utils.append_to_clob(l_where_stmt,' ( '||l_not_equal_stmt||' ) or ');
362- end if;
363364 end if;
364365 --If its inclusion we expect a actual set to fully match and have no extra elements over expected
365366 if a_inclusion_type then
@@ -499,6 +500,8 @@ create or replace package body ut_compound_data_helper is
499500 case when final_order = 1 then to_char(rn) else col_name end,
500501 case when final_order = 1 then to_char(rnk) else col_name end
501502 ]'
503+ else
504+ null
502505 end;
503506 execute immediate l_sql
504507 bulk collect into l_results
0 commit comments