CREATE OR REPLACE PROCEDURE PRO_INVALID_OBJECT
AS
str_sql varchar2(200);
BEGIN
for PRO_INVALID_OBJECT in (select object_name,object_type from all_objects
where owner in ('TRE_DSS','TRE_BUFF','TRE_ODS','METABASE')
and status = 'INVALID'
and object_type in ('MATERIALIZED VIEW','VIEW','PROCEDURE'))
loop
str_sql := 'alter '||PRO_INVALID_OBJECT.OBJECT_TYPE ||‘ ’||PRO_INVALID_OBJECT.object_name || ' compile';
begin
execute immediate str_sql;
exception
--When Others Then Null;
when OTHERS Then
dbms_output.put_line(sqlerrm);
end;
end loop;
END;
AS
str_sql varchar2(200);
BEGIN
for PRO_INVALID_OBJECT in (select object_name,object_type from all_objects
where owner in ('TRE_DSS','TRE_BUFF','TRE_ODS','METABASE')
and status = 'INVALID'
and object_type in ('MATERIALIZED VIEW','VIEW','PROCEDURE'))
loop
str_sql := 'alter '||PRO_INVALID_OBJECT.OBJECT_TYPE ||‘ ’||PRO_INVALID_OBJECT.object_name || ' compile';
begin
execute immediate str_sql;
exception
--When Others Then Null;
when OTHERS Then
dbms_output.put_line(sqlerrm);
end;
end loop;
END;