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

Skip to content

Commit 006ce6f

Browse files
authored
Merge pull request #362 from jgebal/feature/improved_install_scripts
Install and Uninstall scripts are now much more readable
2 parents 65d0169 + fba1291 commit 006ce6f

7 files changed

Lines changed: 381 additions & 296 deletions

source/create_synonyms_and_grants_for_public.sql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,13 @@
1717
Create all necessary grant for the user who owns test packages and want to execute utPLSQL framework
1818
*/
1919

20+
@@define_ut3_owner_param.sql
21+
2022
set echo off
2123
set feedback on
2224
set heading off
2325
set verify off
2426

25-
define ut3_owner = &1
26-
2727
prompt Granting privileges on UTPLSQL objects in &&ut3_owner schema to PUBLIC
2828

2929
whenever sqlerror exit failure rollback

source/create_synonyms_and_grants_for_user.sql

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,33 @@
1717
Create all necessary grant for the user who owns test packages and want to execute utPLSQL framework
1818
*/
1919

20+
@@define_ut3_owner_param.sql
21+
22+
column 2 new_value 2 noprint
23+
select null as "2" from dual where 1=0;
24+
spool params.sql.tmp
25+
select
26+
case
27+
when '&&2' is null then q'[ACCEPT ut3_user CHAR PROMPT 'Provide schema name where synonyms for the utPLSQL v3 should be created ']'
28+
else 'define ut3_user=&&2'
29+
end
30+
from dual;
31+
spool off
32+
set termout on
33+
@params.sql.tmp
34+
set termout off
35+
/* cleanup temporary sql files */
36+
--try running on windows
37+
$ del params.sql.tmp
38+
--try running on linux/unix
39+
! rm params.sql.tmp
40+
set termout on
41+
2042
set echo off
2143
set feedback on
2244
set heading off
2345
set verify off
2446

25-
define ut3_owner = &1
26-
define ut3_user = &2
27-
2847
prompt Granting privileges on UTPLSQL objects in &&ut3_owner schema to user &&ut3_user
2948

3049
whenever sqlerror exit failure rollback

source/define_ut3_owner_param.sql

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
set serveroutput on size unlimited format truncated
2+
whenever oserror continue
3+
4+
set heading off
5+
set linesize 1000
6+
set pagesize 0
7+
8+
set verify off
9+
set define on
10+
11+
set termout off
12+
set timing off
13+
set feedback off
14+
15+
column line_separator new_value line_separator noprint
16+
select '--------------------------------------------------------------' as line_separator from dual;
17+
18+
column 1 new_value 1 noprint
19+
select null as "1" from dual where 1=0;
20+
spool params.sql.tmp
21+
select
22+
case
23+
when '&&1' is null then q'[ACCEPT ut3_owner CHAR DEFAULT 'UT3' PROMPT 'Provide schema for the utPLSQL v3 (UT3)']'
24+
else 'define ut3_owner=&&1'
25+
end
26+
from dual;
27+
spool off
28+
set termout on
29+
@params.sql.tmp
30+
set termout off
31+
/* cleanup temporary sql files */
32+
--try running on windows
33+
$ del params.sql.tmp
34+
--try running on linux/unix
35+
! rm params.sql.tmp
36+
set termout on

0 commit comments

Comments
 (0)