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

Skip to content

Commit 801975a

Browse files
authored
Merge branch 'develop' into documentation-fixes-part3
2 parents eebbca3 + e0e8eb6 commit 801975a

3 files changed

Lines changed: 250 additions & 269 deletions

File tree

source/core/ut_metadata.pkb

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,5 +159,19 @@ create or replace package body ut_metadata as
159159
return replace(l_result,'dba_','all_');
160160
end;
161161

162+
function package_exists_in_cur_schema(a_object_name varchar2) return boolean is
163+
l_cnt number;
164+
c_current_schema constant all_tables.owner%type := sys_context('USERENV','CURRENT_SCHEMA');
165+
begin
166+
select count(*)
167+
into l_cnt
168+
from all_objects t
169+
where t.object_name = a_object_name
170+
and t.object_type = 'PACKAGE'
171+
and t.owner = c_current_schema;
172+
return l_cnt > 0;
173+
end;
174+
175+
162176
end;
163177
/

source/core/ut_metadata.pks

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,5 +69,11 @@ create or replace package ut_metadata authid current_user as
6969
*/
7070
function get_dba_view(a_dba_view_name varchar2) return varchar2;
7171

72+
/**
73+
* Returns true if given object is a package and it exists in current schema
74+
* @param a_object_name the name of the object to be checked
75+
*/
76+
function package_exists_in_cur_schema(a_object_name varchar2) return boolean;
77+
7278
end ut_metadata;
7379
/

0 commit comments

Comments
 (0)