You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -214,9 +212,7 @@ create or replace package body ut_compound_data_helper is
214
212
where act_data_id is null or exp_data_id is null]'
215
213
bulk collect into l_results
216
214
using a_join_by_xpath, a_diff_id, a_expected_dataset_guid,a_actual_dataset_guid;
217
-
218
-
dbms_output.put_line((dbms_utility.get_time - t1)/100 || ' seconds - get col info');
219
-
215
+
220
216
return l_results;
221
217
end;
222
218
@@ -765,105 +761,141 @@ create or replace package body ut_compound_data_helper is
765
761
return l_sql;
766
762
end;
767
763
768
-
function generate_xmltab_stmt (a_column_info xmltype) return varchar2 is
769
-
l_sql_stmt varchar2(32767);
770
-
begin
771
-
for i in (select /*+ CARDINALITY(xt 100) */
772
-
xt.name
773
-
from (select a_column_info item_data from dual) x,
774
-
xmltable(
775
-
'/ROW/*'
776
-
passing x.item_data
777
-
columns
778
-
name varchar2(4000) PATH '@xml_valid_name'
779
-
) xt)
780
-
loop
781
-
l_sql_stmt := l_sql_stmt || case when l_sql_stmt is null then null else ',' end ||i.name||q'[ varchar2(4000) PATH ']'||i.name||q'[']';
764
+
function generate_xmltab_stmt (a_column_info ut_varchar2_list, a_inc_filter ut_varchar2_list, a_exc_filter ut_varchar2_list) return clob is
765
+
l_sql_stmt clob;
766
+
begin
767
+
for i in 1..a_column_info.count loop
768
+
l_sql_stmt := l_sql_stmt || case when l_sql_stmt is null then null else ',' end ||a_column_info(i)||q'[ varchar2(4000) PATH ']'||a_column_info(i)||q'[']';
782
769
end loop;
783
770
return l_sql_stmt;
784
771
end;
785
-
786
-
function generate_equal_sql (a_column_info xmltype) return varchar2 is
787
-
l_sql_stmt varchar2(32767);
772
+
773
+
function generate_equal_sql (a_column_info ut_varchar2_list, a_inc_filter ut_varchar2_list, a_exc_filter ut_varchar2_list) return clob is
774
+
l_sql_stmt clob;
788
775
begin
789
-
for i in (select /*+ CARDINALITY(xt 100) */
790
-
xt.name
791
-
from (select a_column_info item_data from dual) x,
792
-
xmltable(
793
-
'/ROW/*'
794
-
passing x.item_data
795
-
columns
796
-
name varchar2(4000) PATH '@xml_valid_name'
797
-
) xt)
776
+
for i in 1..a_column_info.count loop
777
+
l_sql_stmt := l_sql_stmt || case when l_sql_stmt is null then null else ' and ' end ||' a.'||a_column_info(i)||q'[ = ]'||' e.'||a_column_info(i);
778
+
end loop;
779
+
780
+
return l_sql_stmt;
781
+
end;
782
+
783
+
function generate_join_by_on_stmt (a_join_by_xpath_tab ut_varchar2_list) return clob is
784
+
l_sql_stmt clob;
785
+
begin
786
+
for i in (with xpaths_tab as (select column_value xpath from table(a_join_by_xpath_tab))
787
+
select REGEXP_SUBSTR (xpath,'[^(/\*/)](.+)$') name
788
+
from xpaths_tab)
798
789
loop
799
790
l_sql_stmt := l_sql_stmt || case when l_sql_stmt is null then null else ' and ' end ||' a.'||i.name||q'[ = ]'||' e.'||i.name;
800
791
end loop;
801
792
return l_sql_stmt;
802
793
end;
803
-
804
-
function generate_not_equal_sql (a_column_info xmltype, a_join_by_xpath varchar2) return varchar2 is
||q'[act as (select ucd.*, x.item_no,x.data_id from (select item_data,item_no,data_id from ]' || l_ut_owner || q'[.ut_compound_data_tmp where data_id = :other_guid) x,]'
ut_utils.append_to_clob(l_compare_sql,ut_compound_data_helper.generate_equal_sql(l_col_info_tab, l_xpath_inc_tab, l_xpath_exc_tab)||q'[ ) where a.data_id is null or e.data_id is null]');
879
+
else
880
+
-- If key defined do the join or these and where on diffrences
||q'[act as (select xt.*, x.item_no,x.data_id from (select item_data,item_no,data_id from ]' || l_ut_owner || q'[.ut_compound_data_tmp where data_id = :other_guid) x,]'
0 commit comments