Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit ca9f8eb

Browse files
committed
Formatting fixes.
1 parent 62c12cd commit ca9f8eb

4 files changed

Lines changed: 322 additions & 300 deletions

File tree

source/expectations/data_values/ut_compound_data_helper.pkb

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -780,7 +780,12 @@ create or replace package body ut_compound_data_helper is
780780
end if;
781781
end;
782782

783-
function is_collection (a_owner varchar2,a_type_name varchar2, a_anytype_code in integer :=null) return boolean is
783+
function is_collection (a_anytype_code in integer) return boolean is
784+
begin
785+
return a_anytype_code in (dbms_types.typecode_varray,dbms_types.typecode_table,dbms_types.typecode_namedcollection);
786+
end;
787+
788+
function is_collection (a_owner varchar2, a_type_name varchar2, a_anytype_code in integer :=null) return boolean is
784789
l_type_view varchar2(200) := ut_metadata.get_dba_view('dba_types');
785790
l_typecode varchar2(100);
786791
begin
@@ -791,21 +796,14 @@ create or replace package body ut_compound_data_helper is
791796

792797
return l_typecode = 'COLLECTION';
793798
else
794-
return a_anytype_code in (dbms_types.typecode_varray,dbms_types.typecode_table,dbms_types.typecode_namedcollection);
799+
return is_collection(a_anytype_code);
795800
end if;
796801

797802
exception
798803
when no_data_found then
799804
return false;
800805
end;
801806

802-
function is_collection (a_anytype_code in integer) return boolean is
803-
l_type_view varchar2(200) := ut_metadata.get_dba_view('dba_types');
804-
l_typecode varchar2(100);
805-
begin
806-
return a_anytype_code in (dbms_types.typecode_varray,dbms_types.typecode_table,dbms_types.typecode_namedcollection);
807-
end;
808-
809807
function get_column_type_desc(a_type_code in integer, a_dbms_sql_desc in boolean) return varchar2 is
810808
begin
811809
return case when a_dbms_sql_desc then g_type_name_map(a_type_code) else g_anytype_name_map(a_type_code) end;
Lines changed: 53 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -1,50 +1,53 @@
1-
create or replace type body ut_cursor_column as
2-
3-
member procedure init(self in out nocopy ut_cursor_column,
4-
a_col_name varchar2, a_col_schema_name varchar2,
5-
a_col_type_name varchar2, a_col_max_len integer, a_parent_name varchar2 := null, a_hierarchy_level integer := 1,
6-
a_col_position integer, a_col_type varchar2, a_collection integer,a_access_path in varchar2) is
7-
begin
8-
self.parent_name := a_parent_name; --Name of the parent if its nested
9-
self.hierarchy_level := a_hierarchy_level; --Hierarchy level
10-
self.column_position := a_col_position; --Position of the column in cursor/ type
11-
self.column_len := a_col_max_len; --length of column
12-
self.column_name := TRIM( BOTH '''' FROM a_col_name); --name of the column
13-
self.column_type_name := a_col_type_name; --type name e.g. test_dummy_object or varchar2
14-
self.access_path := case when a_access_path is null then
15-
self.column_name
16-
else
17-
a_access_path||'/'||self.column_name
18-
end; --Access path used for incldue exclude eg/ TEST_DUMMY_OBJECT/VARCHAR2
19-
self.xml_valid_name := '"'||self.column_name||'"'; --User friendly column name
20-
self.transformed_name := case when self.parent_name is null then
21-
self.xml_valid_name
22-
else
23-
'"'||ut_compound_data_helper.get_fixed_size_hash(self.parent_name||self.column_name)||'"'
24-
end; --when is nestd we need to hash name to make sure we dont exceed 30 char
25-
self.column_type := a_col_type; --column type e.g. user_defined , varchar2
26-
self.column_schema := a_col_schema_name; -- schema name
27-
self.is_sql_diffable := case when lower(self.column_type) = 'user_defined_type' then
28-
0
29-
else
30-
ut_utils.boolean_to_int(ut_compound_data_helper.is_sql_compare_allowed(self.column_type))
31-
end; --can we directly compare or do we need to hash value
32-
self.is_collection := a_collection;
33-
self.has_nested_col := case when lower(self.column_type) = 'user_defined_type' and self.is_collection = 0 then 1 else 0 end;
34-
end;
35-
36-
constructor function ut_cursor_column( self in out nocopy ut_cursor_column,
37-
a_col_name varchar2, a_col_schema_name varchar2,
38-
a_col_type_name varchar2, a_col_max_len integer, a_parent_name varchar2 := null, a_hierarchy_level integer := 1,
39-
a_col_position integer, a_col_type in varchar2, a_collection integer,a_access_path in varchar2) return self as result is
40-
begin
41-
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, a_col_type, a_collection,a_access_path);
42-
return;
43-
end;
44-
45-
constructor function ut_cursor_column( self in out nocopy ut_cursor_column) return self as result is
46-
begin
47-
return;
48-
end;
49-
end;
50-
/
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
8+
) is
9+
begin
10+
self.parent_name := a_parent_name; --Name of the parent if its nested
11+
self.hierarchy_level := a_hierarchy_level; --Hierarchy level
12+
self.column_position := a_col_position; --Position of the column in cursor/ type
13+
self.column_len := a_col_max_len; --length of column
14+
self.column_name := TRIM( BOTH '''' FROM a_col_name); --name of the column
15+
self.column_type_name := a_col_type_name; --type name e.g. test_dummy_object or varchar2
16+
self.access_path := case when a_access_path is null then
17+
self.column_name
18+
else
19+
a_access_path||'/'||self.column_name
20+
end; --Access path used for incldue exclude eg/ TEST_DUMMY_OBJECT/VARCHAR2
21+
self.xml_valid_name := '"'||self.column_name||'"'; --User friendly column name
22+
self.transformed_name := case when self.parent_name is null then
23+
self.xml_valid_name
24+
else
25+
'"'||ut_compound_data_helper.get_fixed_size_hash(self.parent_name||self.column_name)||'"'
26+
end; --when is nestd we need to hash name to make sure we dont exceed 30 char
27+
self.column_type := a_col_type; --column type e.g. user_defined , varchar2
28+
self.column_schema := a_col_schema_name; -- schema name
29+
self.is_sql_diffable := case when lower(self.column_type) = 'user_defined_type' then
30+
0
31+
else
32+
ut_utils.boolean_to_int(ut_compound_data_helper.is_sql_compare_allowed(self.column_type))
33+
end; --can we directly compare or do we need to hash value
34+
self.is_collection := a_collection;
35+
self.has_nested_col := case when lower(self.column_type) = 'user_defined_type' and self.is_collection = 0 then 1 else 0 end;
36+
end;
37+
38+
constructor function ut_cursor_column( self in out nocopy ut_cursor_column,
39+
a_col_name varchar2, a_col_schema_name varchar2,
40+
a_col_type_name varchar2, a_col_max_len integer, a_parent_name varchar2 := null, a_hierarchy_level integer := 1,
41+
a_col_position integer, a_col_type in varchar2, a_collection integer,a_access_path in varchar2
42+
) return self as result is
43+
begin
44+
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, a_col_type, a_collection,a_access_path);
45+
return;
46+
end;
47+
48+
constructor function ut_cursor_column( self in out nocopy ut_cursor_column) return self as result is
49+
begin
50+
return;
51+
end;
52+
end;
53+
/

0 commit comments

Comments
 (0)