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
fix validation for test packages defined by another user because PACK…
…AGE_BODY state is hidden in all_objects view
  • Loading branch information
Pazus committed Aug 1, 2016
commit 2416c38e6e905143b7207121cfcbcf371a80933c
11 changes: 5 additions & 6 deletions source/ut_metadata.pkb
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ create or replace package body ut_metadata as
end form_name;

function package_valid(a_owner_name varchar2, a_package_name in varchar2) return boolean as
v_cnt number;
v_prc number;
name varchar2(200);
schema varchar2(200);
part1 varchar2(200);
Expand All @@ -51,16 +51,15 @@ create or replace package body ut_metadata as

do_resolve(schema, part1, part2);

select count(*)
into v_cnt
select count(decode(status, 'VALID', 1, null)) / count(*)
into v_prc
from all_objects
where owner = schema
and object_name = part1
and object_type in ('PACKAGE', 'PACKAGE BODY')
and status = 'VALID';
and object_type in ('PACKAGE', 'PACKAGE BODY');

-- expect both package and body to be valid
return v_cnt = 2;
return v_prc = 1;
exception
when others then
return false;
Expand Down