@@ -14,8 +14,11 @@ create or replace type body ut_cursor_column as
1414 self.column_len := a_col_max_len; --length of column
1515 self.column_precision := a_col_precision;
1616 self.column_scale := a_col_scale;
17- self.column_name := TRIM( BOTH '''' FROM a_col_name); --name of the column
1817 self.column_type_name := coalesce(a_col_type_name,a_col_type); --type name e.g. test_dummy_object or varchar2
18+ self.column_name := case when a_col_name is null and a_collection = 1 then
19+ self.column_type_name
20+ else TRIM( BOTH '''' FROM a_col_name)
21+ end; --name of the column, however in nested object for collection name is not defined in cursor.
1922 self.xml_valid_name := ut_utils.get_valid_xml_name(self.column_name);
2023 self.display_path := case when a_access_path is null then
2124 self.column_name
@@ -25,15 +28,16 @@ create or replace type body ut_cursor_column as
2528 self.access_path := case when a_access_path is null then
2629 self.xml_valid_name
2730 else
28- a_access_path||'/'||self.xml_valid_name
31+ a_access_path||'/'||self.xml_valid_name
2932 end; --Access path used for XMLTABLE query
3033 self.filter_path := '/'||self.access_path; --Filter path will differ from access path in anydata type
34+ --Transformed name needs to be build on full access path to avoid ambiguity when there is 3 or more levels of nesting.
3135 self.transformed_name := case when length(self.xml_valid_name) > 30 then
32- '"'||ut_compound_data_helper.get_fixed_size_hash(self.parent_name||self.xml_valid_name )||'"'
36+ '"'||ut_compound_data_helper.get_fixed_size_hash(self.access_path )||'"'
3337 when self.parent_name is null then
3438 '"'||self.xml_valid_name||'"'
3539 else
36- '"'||ut_compound_data_helper.get_fixed_size_hash(self.parent_name||self.xml_valid_name )||'"'
40+ '"'||ut_compound_data_helper.get_fixed_size_hash(self.access_path )||'"'
3741 end; --when is nestd we need to hash name to make sure we dont exceed 30 char
3842 self.column_type := a_col_type; --column type e.g. user_defined , varchar2
3943 self.column_schema := a_col_schema_name; -- schema name
0 commit comments