|
1 | | -create or replace type body ut_cursor_column as |
2 | | - |
3 | | - member procedure init( |
4 | | - self in out nocopy ut_cursor_column, |
5 | | - a_col_name varchar2, a_col_schema_name varchar2, |
6 | | - a_col_type_name varchar2, a_col_max_len integer, a_parent_name varchar2 := null, a_hierarchy_level integer := 1, |
7 | | - a_col_position integer, a_col_type varchar2, a_collection integer,a_access_path in varchar2, a_col_precision in integer, |
8 | | - a_col_scale integer |
9 | | - ) is |
10 | | - begin |
11 | | - self.parent_name := a_parent_name; --Name of the parent if its nested |
12 | | - self.hierarchy_level := a_hierarchy_level; --Hierarchy level |
13 | | - self.column_position := a_col_position; --Position of the column in cursor/ type |
14 | | - self.column_len := a_col_max_len; --length of column |
15 | | - self.column_precision := a_col_precision; |
16 | | - self.column_scale := a_col_scale; |
17 | | - self.column_name := TRIM( BOTH '''' FROM a_col_name); --name of the column |
18 | | - self.column_type_name := coalesce(a_col_type_name,a_col_type); --type name e.g. test_dummy_object or varchar2 |
19 | | - self.xml_valid_name := ut_utils.get_valid_xml_name(self.column_name); |
20 | | - self.display_path := case when a_access_path is null then |
21 | | - self.column_name |
22 | | - else |
23 | | - a_access_path||'/'||self.column_name |
24 | | - end; --Access path used for incldue exclude eg/ TEST_DUMMY_OBJECT/VARCHAR2 |
25 | | - self.access_path := case when a_access_path is null then |
26 | | - self.xml_valid_name |
27 | | - else |
28 | | - a_access_path||'/'||self.xml_valid_name |
29 | | - end; --Access path used for XMLTABLE query |
30 | | - self.filter_path := '/'||self.access_path; --Filter path will differ from access path in anydata type |
31 | | - 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)||'"' |
33 | | - when self.parent_name is null then |
34 | | - '"'||self.xml_valid_name||'"' |
35 | | - else |
36 | | - '"'||ut_compound_data_helper.get_fixed_size_hash(self.parent_name||self.xml_valid_name)||'"' |
37 | | - end; --when is nestd we need to hash name to make sure we dont exceed 30 char |
38 | | - self.column_type := a_col_type; --column type e.g. user_defined , varchar2 |
39 | | - self.column_schema := a_col_schema_name; -- schema name |
40 | | - self.is_sql_diffable := case |
41 | | - when lower(self.column_type) = 'user_defined_type' then |
42 | | - 0 |
43 | | - -- Due to bug in 11g/12.1 collection fails on varchar 4000+ |
44 | | - when (lower(self.column_type) in ('varchar2','char')) and (self.column_len > 4000) then |
45 | | - 0 |
46 | | - else |
47 | | - ut_utils.boolean_to_int(ut_compound_data_helper.is_sql_compare_allowed(self.column_type)) |
48 | | - end; --can we directly compare or do we need to hash value |
49 | | - self.is_collection := a_collection; |
50 | | - self.has_nested_col := case when lower(self.column_type) = 'user_defined_type' and self.is_collection = 0 then 1 else 0 end; |
51 | | - end; |
52 | | - |
53 | | - constructor function ut_cursor_column( self in out nocopy ut_cursor_column, |
54 | | - a_col_name varchar2, a_col_schema_name varchar2, |
55 | | - a_col_type_name varchar2, a_col_max_len integer, a_parent_name varchar2 := null, a_hierarchy_level integer := 1, |
56 | | - a_col_position integer, a_col_type in varchar2, a_collection integer,a_access_path in varchar2, a_col_precision in integer, |
57 | | - a_col_scale integer |
58 | | - ) return self as result is |
59 | | - begin |
60 | | - init(a_col_name, a_col_schema_name, a_col_type_name, a_col_max_len, a_parent_name,a_hierarchy_level, a_col_position, |
61 | | - a_col_type, a_collection,a_access_path,a_col_precision,a_col_scale); |
62 | | - return; |
63 | | - end; |
64 | | - |
65 | | - constructor function ut_cursor_column( self in out nocopy ut_cursor_column) return self as result is |
66 | | - begin |
67 | | - return; |
68 | | - end; |
69 | | -end; |
70 | | -/ |
| 1 | +create or replace type body ut_cursor_column as |
| 2 | + |
| 3 | + member procedure init( |
| 4 | + self in out nocopy ut_cursor_column, |
| 5 | + a_col_name varchar2, a_col_schema_name varchar2, |
| 6 | + a_col_type_name varchar2, a_col_max_len integer, a_parent_name varchar2 := null, a_hierarchy_level integer := 1, |
| 7 | + a_col_position integer, a_col_type varchar2, a_collection integer,a_access_path in varchar2, a_col_precision in integer, |
| 8 | + a_col_scale integer |
| 9 | + ) is |
| 10 | + begin |
| 11 | + self.parent_name := a_parent_name; --Name of the parent if its nested |
| 12 | + self.hierarchy_level := a_hierarchy_level; --Hierarchy level |
| 13 | + self.column_position := a_col_position; --Position of the column in cursor/ type |
| 14 | + self.column_len := a_col_max_len; --length of column |
| 15 | + self.column_precision := a_col_precision; |
| 16 | + self.column_scale := a_col_scale; |
| 17 | + self.column_name := TRIM( BOTH '''' FROM a_col_name); --name of the column |
| 18 | + self.column_type_name := coalesce(a_col_type_name,a_col_type); --type name e.g. test_dummy_object or varchar2 |
| 19 | + self.xml_valid_name := ut_utils.get_valid_xml_name(self.column_name); |
| 20 | + self.display_path := case when a_access_path is null then |
| 21 | + self.column_name |
| 22 | + else |
| 23 | + a_access_path||'/'||self.column_name |
| 24 | + end; --Access path used for incldue exclude eg/ TEST_DUMMY_OBJECT/VARCHAR2 |
| 25 | + self.access_path := case when a_access_path is null then |
| 26 | + self.xml_valid_name |
| 27 | + else |
| 28 | + a_access_path||'/'||self.xml_valid_name |
| 29 | + end; --Access path used for XMLTABLE query |
| 30 | + self.filter_path := '/'||self.access_path; --Filter path will differ from access path in anydata type |
| 31 | + 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)||'"' |
| 33 | + when self.parent_name is null then |
| 34 | + '"'||self.xml_valid_name||'"' |
| 35 | + else |
| 36 | + '"'||ut_compound_data_helper.get_fixed_size_hash(self.parent_name||self.xml_valid_name)||'"' |
| 37 | + end; --when is nestd we need to hash name to make sure we dont exceed 30 char |
| 38 | + self.column_type := a_col_type; --column type e.g. user_defined , varchar2 |
| 39 | + self.column_schema := a_col_schema_name; -- schema name |
| 40 | + self.is_sql_diffable := case |
| 41 | + when lower(self.column_type) = 'user_defined_type' then |
| 42 | + 0 |
| 43 | + -- Due to bug in 11g/12.1 collection fails on varchar 4000+ |
| 44 | + when (lower(self.column_type) in ('varchar2','char')) and (self.column_len > 4000) then |
| 45 | + 0 |
| 46 | + else |
| 47 | + ut_utils.boolean_to_int(ut_compound_data_helper.is_sql_compare_allowed(self.column_type)) |
| 48 | + end; --can we directly compare or do we need to hash value |
| 49 | + self.is_collection := a_collection; |
| 50 | + self.has_nested_col := case when lower(self.column_type) = 'user_defined_type' and self.is_collection = 0 then 1 else 0 end; |
| 51 | + end; |
| 52 | + |
| 53 | + constructor function ut_cursor_column( self in out nocopy ut_cursor_column, |
| 54 | + a_col_name varchar2, a_col_schema_name varchar2, |
| 55 | + a_col_type_name varchar2, a_col_max_len integer, a_parent_name varchar2 := null, a_hierarchy_level integer := 1, |
| 56 | + a_col_position integer, a_col_type in varchar2, a_collection integer,a_access_path in varchar2, a_col_precision in integer, |
| 57 | + a_col_scale integer |
| 58 | + ) return self as result is |
| 59 | + begin |
| 60 | + init(a_col_name, a_col_schema_name, a_col_type_name, a_col_max_len, a_parent_name,a_hierarchy_level, a_col_position, |
| 61 | + a_col_type, a_collection,a_access_path,a_col_precision,a_col_scale); |
| 62 | + return; |
| 63 | + end; |
| 64 | + |
| 65 | + constructor function ut_cursor_column( self in out nocopy ut_cursor_column) return self as result is |
| 66 | + begin |
| 67 | + return; |
| 68 | + end; |
| 69 | +end; |
| 70 | +/ |
0 commit comments