-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstallobjects.sql
62 lines (49 loc) · 1.49 KB
/
installobjects.sql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
prompt Installing PLSSQL Checkstyle Framework
set serveroutput on size unlimited
define plscope_owner = &1
whenever sqlerror exit failure rollback
whenever oserror exit failure rollback
alter session set current_schema = &&plscope_owner;
set define off
prompt Deploying Types
--common utilities
@@core/types/VARCHAR2_TAB.tps
@@core/types/T_OBJECT.tps
@@core/types/T_OBJECTS.tps
@@core/types/T_SCOPE_RESULT_ROW.tps
@@core/types/T_SCOPE_RESULT_ROWS.tps
@@core/types/T_SCOPE_ROW.tps
@@core/types/T_SCOPE_ROWS.tps
@@core/types/T_SCOPE_RULE.tps
@@core/types/T_SCOPE_RULES.tps
prompt Deploying Tables
@@core/create_gtt_scope_rows.sql
@@core/create_gtt_validation_res.sql
@@core/create_ruletable.sql
@@core/create_exclusion_table.sql
prompt Deploying Packages
@@core/PLSQLSCOPE_METADATA.pks
@@core/PLSQLSCOPE_METADATA.pkb
@@core/PLSQLSCOPE_HELPER.pks
@@core/PLSQLSCOPE_HELPER.pkb
@@core/PLSSQLSCOPE_API.pks
@@core/PLSSQLSCOPE_API.pkb
set linesize 200
set define &
column text format a100
column error_count noprint new_value error_count
prompt Validating installation
select name, type, sequence, line, position, text, count(1) over() error_count
from all_errors
where owner = upper('&&plscope_owner')
and name not like 'BIN$%' --not recycled
and (name = 'UT' or name like 'UT\_%' escape '\')
-- errors only. ignore warnings
and attribute = 'ERROR'
/
begin
if to_number('&&error_count') > 0 then
raise_application_error(-20000, 'Not all sources were successfully installed.');
end if;
end;
/