@@ -144,7 +144,9 @@ create or replace package body ut_compound_data_helper is
144144 l_index := a_pk_table.next(l_index);
145145 end loop;
146146 end if;
147- if not(l_exists) then
147+ if a_data_info.column_type in ('OBJECT') then
148+ null;
149+ elsif not(l_exists) then
148150 l_sql_stmt := ' (decode(a.'||a_data_info.transformed_name||','||' e.'||a_data_info.transformed_name||',1,0) = 0)';
149151 end if;
150152 return l_sql_stmt;
@@ -161,7 +163,9 @@ create or replace package body ut_compound_data_helper is
161163 if l_pk_tab.count <> 0 then
162164 l_index:= l_pk_tab.first;
163165 loop
164- if l_pk_tab(l_index) in (a_data_info.access_path, a_data_info.parent_name) then
166+ if a_data_info.column_type in ('OBJECT') then
167+ null;
168+ elsif l_pk_tab(l_index) in (a_data_info.access_path, a_data_info.parent_name) then
165169 --When then table is nested and join is on whole table
166170 l_sql_stmt := l_sql_stmt ||' a.'||a_data_info.transformed_name||q'[ = ]'||' e.'||a_data_info.transformed_name;
167171 end if;
@@ -187,15 +191,21 @@ create or replace package body ut_compound_data_helper is
187191 if a_pk_table is not empty then
188192 l_index:= a_pk_table.first;
189193 loop
190- if a_pk_table(l_index) in (a_data_info.access_path, a_data_info.parent_name) then
194+ if a_data_info.column_type in ('OBJECT') then
195+ null;
196+ elsif a_pk_table(l_index) in (a_data_info.access_path, a_data_info.parent_name) then
191197 --When then table is nested and join is on whole table
192198 l_sql_stmt := l_sql_stmt ||a_alias||a_data_info.transformed_name;
193199 end if;
194200 exit when (a_data_info.access_path = a_pk_table(l_index)) or l_index = a_pk_table.count;
195201 l_index := a_pk_table.next(l_index);
196202 end loop;
197203 else
198- l_sql_stmt := a_alias||a_data_info.transformed_name;
204+ if a_data_info.column_type in ('OBJECT') then
205+ null;
206+ else
207+ l_sql_stmt := a_alias||a_data_info.transformed_name;
208+ end if;
199209 end if;
200210 return l_sql_stmt;
201211 end;
@@ -206,7 +216,9 @@ create or replace package body ut_compound_data_helper is
206216 l_alias varchar2(10) := a_alias;
207217 l_col_syntax varchar2(4000);
208218 begin
209- if a_data_info.is_sql_diffable = 0 then
219+ if a_data_info.column_type in ('OBJECT') then
220+ null;
221+ elsif a_data_info.is_sql_diffable = 0 then
210222 l_col_syntax := 'ut_utils.get_hash('||l_alias||a_data_info.transformed_name||'.getClobVal()) as '||a_data_info.transformed_name ;
211223 elsif a_data_info.is_sql_diffable = 1 and a_data_info.column_type = 'DATE' then
212224 l_col_syntax := 'to_date('||l_alias||a_data_info.transformed_name||') as '|| a_data_info.transformed_name;
@@ -238,14 +250,20 @@ create or replace package body ut_compound_data_helper is
238250 --We cannot use a precision and scale as dbms_sql.describe_columns3 return precision 0 for dual table
239251 -- there is also no need for that as we not process data but only read and compare as they are stored
240252 l_col_type := a_data_info.column_type;
253+ elsif a_data_info.column_type in ('OBJECT') then
254+ null;
241255 else
242256 l_col_type := a_data_info.column_type
243257 ||case when a_data_info.column_len is not null
244258 then '('||a_data_info.column_len||')'
245259 else null
246260 end;
247261 end if;
248- return a_data_info.transformed_name||' '||l_col_type||q'[ PATH ']'||a_data_info.access_path||q'[']';
262+ if a_data_info.column_type in ('OBJECT') then
263+ return null;
264+ else
265+ return a_data_info.transformed_name||' '||l_col_type||q'[ PATH ']'||a_data_info.access_path||q'[']';
266+ end if;
249267 end;
250268
251269 procedure gen_sql_pieces_out_of_cursor(
@@ -398,8 +416,12 @@ create or replace package body ut_compound_data_helper is
398416 l_column_list ut_varchar2_list := ut_varchar2_list();
399417 begin
400418 for i in 1..a_cursor_info.count loop
401- l_column_list.extend;
402- l_column_list(l_column_list.last) := a_cursor_info(i).access_path;
419+ --This avoids extracting single columns from nested objects.
420+ --as we can go down to any level but we will lose visibility of parent.
421+ if a_cursor_info(i).hierarchy_level = 1 then
422+ l_column_list.extend;
423+ l_column_list(l_column_list.last) := a_cursor_info(i).access_path;
424+ end if;
403425 end loop;
404426 return l_column_list;
405427 end;
@@ -571,6 +593,7 @@ create or replace package body ut_compound_data_helper is
571593 xmlelement( name "ROW", a_diff_tab(idx).act_item_data), a_diff_tab(idx).act_data_id,
572594 xmlelement( name "ROW", a_diff_tab(idx).exp_item_data), a_diff_tab(idx).exp_data_id,
573595 a_diff_tab(idx).item_no, a_diff_tab(idx).dup_no);
596+
574597 exception
575598 when ut_utils.ex_failure_for_all then
576599 raise_application_error(ut_utils.gc_dml_for_all,'Failure to insert a diff tmp data.');
0 commit comments