I have a problem, when I try to compile my project in Oracle Database. To make it more simple, I have three objects: 2 packages (UTILS and TYPES) and 1 view (VIEW).
Package UTILS is using types defined in package TYPES. Package TYPES is using VIEW as a base for one of it's types. And VIEW is using functions from package UTILS in it's script. When I try to make some changes to one of these objects, I can't compile because everything is in invalid state. So some kind of object dependency loop is created.
Please help me to resolve this issue.
For example, is there anyway to compile the below code? Each object is individually syntactically correct, but how can they all be compiled together?
create or replace package my_types is
type type1 is table of number;
type type2 is table of my_view%rowtype;
end;
/
create or replace package my_utils is
function get_1 return number;
procedure do_something(parameter my_types.type2);
end;
/
create or replace package body my_utils is
function get_1 return number is
begin
return 1;
end;
procedure do_something(parameter my_types.type2) is
begin
null;
end;
end;
/
create or replace force view my_view as
select * from dual
where 1 = my_utils.get_1();
exec dbms_utility.compile_schema(user, false);
select object_name from user_objects where status <> 'VALID';