declare cursor proce is Select Object_Name,owner,object_type From All_Objects Where Status = ‘INVANID‘ and (Object_type = ‘PROCEDURE‘ or lower(Object_type) = ‘function‘); Strsql Varchar2(200); BEGIN for i in proce loop Strsql:= ‘Alter ‘||i.object_type||‘ ‘||i.owner||‘.‘||i.Object_name||‘ Compile‘; Begin Excute Immediate Strsql; Exception -- When others then Null; when others THEN dbms_output.put_line(i.owner||‘.‘||i.Object_name||‘---‘||Sqlerrm); end; end loop; END;