-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.sql
More file actions
118 lines (88 loc) · 2.34 KB
/
Copy pathinstall.sql
File metadata and controls
118 lines (88 loc) · 2.34 KB
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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
--
-- Demo Installation
--
----------------------------------------
-- Setup
----------------------------------------
-- Capture output
spool install
set serveroutput on size unlimited format truncated
-- Shared Setup Script
@common_setup.sql
WHENEVER SQLERROR exit SQL.SQLCODE
begin
if USER not in ('SYS','SYSTEM')
then
raise_application_error (-20000,
'Not logged in as SYS or SYSTEM');
end if;
end;
/
WHENEVER SQLERROR continue
----------------------------------------
-- Create the schema owner.
----------------------------------------
create user &schema_owner. identified by &schema_owner.
default tablespace users
quota 1M on users
temporary tablespace temp;
grant create session to &schema_owner.;
grant create type to &schema_owner.;
grant create sequence to &schema_owner.;
grant create table to &schema_owner.;
grant create trigger to &schema_owner.;
grant create view to &schema_owner.;
grant create procedure to &schema_owner.;
begin
$IF $$WTPLSQL_ENABLE
$THEN
dbms_output.put_line('WTPLSQL_ENABLE is TRUE');
$END
dbms_output.put_line('Check WTPLSQL_ENABLE is Done.');
end;
/
WHENEVER SQLERROR exit SQL.SQLCODE
----------------------------------------
-- Connect as SCHEMA_OWNER
----------------------------------------
connect &schema_owner./&schema_owner.
set serveroutput on size unlimited format truncated
begin
if USER != upper('&schema_owner')
then
raise_application_error (-20000,
'Not logged in as &schema_owner');
end if;
end;
/
WHENEVER SQLERROR continue
set serveroutput on size unlimited format word_wrapped
select wtplsql.show_version from dual;
begin
wt_assert.eq(msg_in => 'Ad-Hoc Test'
,check_this_in => 1
,against_this_in => '1');
end;
/
----------------------------------------
-- Test Installation
----------------------------------------
prompt Install Package Test
@Package-Test.sql
prompt Install Table Test
@Table-Test.sql
prompt Install Test Runner
@Test-Runner.sql
prompt Install Trigger Test
@Trigger-Test.sql
prompt Install Type Test
@Type-Test.sql
prompt utPLSQL 2.3 ut_betwnstr Example
@ut_betwnstr.sql
prompt utPLSQL 2.3 ut_calc_secs_between Example
@ut_calc_secs_between.sql
prompt utPLSQL 2.3 ut_str Example
@ut_str.sql
prompt utPLSQL 2.3 ut_truncit Example
@ut_truncit.sql
spool off