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

Skip to content
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Update proftab.sql
Fixed syntax errors.
Fixed bug when deploying to different user schema
  • Loading branch information
jgebal authored Jul 3, 2017
commit a8a00936a0974b9b461f35ffbfe33353672ecbff
16 changes: 8 additions & 8 deletions source/core/coverage/proftab.sql
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ declare
l_tab_exist number;
begin
select count(*) into l_tab_exist from
(select table_name from all_tables where table_name = 'PLSQL_PROFILER_RUNS' and owner in (user,'PUBLIC')
(select table_name from all_tables where table_name = 'PLSQL_PROFILER_RUNS' and owner = sys_context('USERENV','CURRENT_SCHEMA')
union all
select synonym_name from user_synonyms where synonym_name = 'PLSQL_PROFILER_RUNS');
select synonym_name from all_synonyms where synonym_name = 'PLSQL_PROFILER_RUNS' and owner = sys_context('USERENV','CURRENT_SCHEMA'));
if l_tab_exist = 0 then
execute immediate q'[create table plsql_profiler_runs
(
Expand All @@ -31,9 +31,9 @@ declare
l_tab_exist number;
begin
select count(*) into l_tab_exist from
(select table_name from all_tables where table_name = 'PLSQL_PROFILER_UNITS' and owner in (user,'PUBLIC')
(select table_name from all_tables where table_name = 'PLSQL_PROFILER_UNITS' and owner = sys_context('USERENV','CURRENT_SCHEMA')
union all
select synonym_name from user_synonyms where synonym_name = 'PLSQL_PROFILER_UNITS');
select synonym_name from user_synonyms where synonym_name = 'PLSQL_PROFILER_UNITS' and owner = sys_context('USERENV','CURRENT_SCHEMA'));
if l_tab_exist = 0 then
execute immediate q'[create table plsql_profiler_units
(
Expand Down Expand Up @@ -62,9 +62,9 @@ declare
l_tab_exist number;
begin
select count(*) into l_tab_exist from
(select table_name from all_tables where table_name = 'PLSQL_PROFILER_DATA' and owner in (user,'PUBLIC');
(select table_name from all_tables where table_name = 'PLSQL_PROFILER_DATA' and owner = sys_context('USERENV','CURRENT_SCHEMA')
union all
select synonym_name from user_synonyms where synonym_name = 'PLSQL_PROFILER_DATA');
select synonym_name from user_synonyms where synonym_name = 'PLSQL_PROFILER_DATA' and owner = sys_context('USERENV','CURRENT_SCHEMA'));
if l_tab_exist = 0 then
execute immediate q'[create table plsql_profiler_data
(
Expand Down Expand Up @@ -94,9 +94,9 @@ declare
l_seq_exist number;
begin
select count(*) into l_seq_exist from
(select sequence_name from all_sequences where sequence_name = 'PLSQL_PROFILER_RUNNUMBER' and sequence_owner in (user,'PUBLIC');
(select sequence_name from all_sequences where sequence_name = 'PLSQL_PROFILER_RUNNUMBER' and sequence_owner = sys_context('USERENV','CURRENT_SCHEMA')
union all
select synonym_name from user_synonyms where synonym_name = 'PLSQL_PROFILER_RUNNUMBER');
select synonym_name from user_synonyms where synonym_name = 'PLSQL_PROFILER_RUNNUMBER' and owner = sys_context('USERENV','CURRENT_SCHEMA'));
if l_seq_exist = 0 then
execute immediate q'[create sequence plsql_profiler_runnumber start with 1 nocache]';
dbms_output.put_line('Sequence PLSQL_PROFILER_RUNNUMBER created');
Expand Down