11create or replace type body ut_column_info_rec as
22
3- member function get_anytype_attributes_info(a_anytype anytype)
3+ member function get_anytype_attributes_info(a_anytype anytype, a_col_name varchar2 )
44 return ut_column_info_tab is
55 l_result ut_column_info_tab := ut_column_info_tab();
66 l_attribute_typecode pls_integer;
@@ -54,7 +54,9 @@ create or replace type body ut_column_info_rec as
5454 null,
5555 l_prec,
5656 l_scale,
57- l_len);
57+ l_len,
58+ false,
59+ a_col_name);
5860 end loop;
5961 return l_result;
6062 end;
@@ -86,23 +88,29 @@ create or replace type body ut_column_info_rec as
8688 a_col_type_name varchar2,
8789 a_col_prec integer,
8890 a_col_scale integer,
89- a_col_len integer,
90- a_dbms_sql_desc boolean := false) is
91+ a_col_max_len integer,
92+ a_dbms_sql_desc boolean := false,
93+ a_parent_name varchar2) is
9194 l_anytype anytype;
9295 begin
9396 self.column_prec := a_col_prec;
94- self.column_len := a_col_len ;
97+ self.column_len := a_col_max_len ;
9598 self.column_scale := a_col_scale;
96- self.xml_valid_name := '"'||a_col_name||'"';
97- self.column_name := a_col_name;
99+ self.column_name := TRIM(BOTH '''' FROM a_col_name);
100+ self.xml_valid_name := '"'||self.column_name||'"';
101+ self.hashed_name := case when a_parent_name is not null then
102+ ut_compound_data_helper.get_hash(utl_raw.cast_to_raw(a_parent_name||self.column_name))
103+ else
104+ null
105+ end;
98106 self.column_type := a_col_type_name;
99107 self.column_schema := a_col_schema_name;
100108 self.is_sql_diffable := 0;
101109 self.is_collection := ut_utils.boolean_to_int(ut_curr_usr_compound_helper.is_collection(a_col_schema_name,a_col_type_name));
102110 self.is_user_defined := 1;
103111
104112 l_anytype := get_user_defined_type(a_col_schema_name, a_col_type_name);
105- self.nested_details := get_anytype_attributes_info(l_anytype);
113+ self.nested_details := get_anytype_attributes_info(l_anytype, self.column_name );
106114 end;
107115
108116 constructor function ut_column_info_rec(self in out nocopy ut_column_info_rec,
@@ -112,18 +120,20 @@ create or replace type body ut_column_info_rec as
112120 a_col_type_name varchar2,
113121 a_col_prec integer,
114122 a_col_scale integer,
115- a_col_len integer,
116- a_dbms_sql_desc boolean := false)
123+ a_col_max_len integer,
124+ a_dbms_sql_desc boolean := false,
125+ a_parent_name varchar2 := null)
117126 return self as result is
118127 begin
119128 if a_col_type = dbms_sql.user_defined_type then
120- self.init(a_col_type, a_col_name, a_col_schema_name, a_col_type_name,a_col_prec,a_col_scale,a_col_len );
129+ self.init(a_col_type, a_col_name, a_col_schema_name, a_col_type_name,a_col_prec,a_col_scale,a_col_max_len );
121130 else
122131 (self as ut_column_info).init(a_col_type,
123132 a_col_name,
124133 a_col_schema_name,
125- a_col_type_name,a_col_prec,a_col_scale,a_col_len,
126- a_dbms_sql_desc);
134+ a_col_type_name,a_col_prec,a_col_scale,a_col_max_len,
135+ a_dbms_sql_desc,
136+ a_parent_name);
127137 end if;
128138 return;
129139 end;
0 commit comments