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

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions source/create_synonyms_and_grants_for_public.sql
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@
Create all necessary grant for the user who owns test packages and want to execute utPLSQL framework
*/

@@define_ut3_owner_param.sql

set echo off
set feedback on
set heading off
set verify off

define ut3_owner = &1

prompt Granting privileges on UTPLSQL objects in &&ut3_owner schema to PUBLIC

whenever sqlerror exit failure rollback
Expand Down
25 changes: 22 additions & 3 deletions source/create_synonyms_and_grants_for_user.sql
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,33 @@
Create all necessary grant for the user who owns test packages and want to execute utPLSQL framework
*/

@@define_ut3_owner_param.sql

column 2 new_value 2 noprint
select null as "2" from dual where 1=0;
spool params.sql.tmp
select
case
when '&&2' is null then q'[ACCEPT ut3_user CHAR PROMPT 'Provide schema name where synonyms for the utPLSQL v3 should be created ']'
else 'define ut3_user=&&2'
end
from dual;
spool off
set termout on
@params.sql.tmp
set termout off
/* cleanup temporary sql files */
--try running on windows
$ del params.sql.tmp
--try running on linux/unix
! rm params.sql.tmp
set termout on

set echo off
set feedback on
set heading off
set verify off

define ut3_owner = &1
define ut3_user = &2

prompt Granting privileges on UTPLSQL objects in &&ut3_owner schema to user &&ut3_user

whenever sqlerror exit failure rollback
Expand Down
36 changes: 36 additions & 0 deletions source/define_ut3_owner_param.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
set serveroutput on size unlimited format truncated
whenever oserror continue

set heading off
set linesize 1000
set pagesize 0

set verify off
set define on

set termout off
set timing off
set feedback off

column line_separator new_value line_separator noprint
select '--------------------------------------------------------------' as line_separator from dual;

column 1 new_value 1 noprint
select null as "1" from dual where 1=0;
spool params.sql.tmp
select
case
when '&&1' is null then q'[ACCEPT ut3_owner CHAR DEFAULT 'UT3' PROMPT 'Provide schema for the utPLSQL v3 (UT3)']'
else 'define ut3_owner=&&1'
end
from dual;
spool off
set termout on
@params.sql.tmp
set termout off
/* cleanup temporary sql files */
--try running on windows
$ del params.sql.tmp
--try running on linux/unix
! rm params.sql.tmp
set termout on
Loading