This content has been marked as final. Show 4 replies
VivaLaVida wrote:compile the INVALID objects
when a procedure gets changed and therefore newly compiled some depending views are getting marked as "invalid". Due to this the depending application raises errors. How could it be established to complie all depending objects (e.g. views) when the procedure gets compiled?
:-) I know that the invalid views need to be compiled - but what I need is a some kind of automatism (if the procedure gets compiled compile all depending views, too).
Spool the output of the following select in a file and then execute the file:
select 'alter '||replace(object_type,'PACKAGE BODY','PACKAGE')||' '||object_name||' compile;'
where status = 'INVALID';
This compiles all invalid objects of a user. After execution you can repeat the step if the compilation of one object has again invalidated some other objects - till the select does not generate any new output.