-- @compsve2.sql
SELECT 'ALTER ' ||
       DECODE (object_type, 'PACKAGE BODY', 'PACKAGE', object_type) ||
       ' ' || object_name || ' COMPILE;'
  FROM user_objects
 WHERE object_type IN (
       'PACKAGE BODY',
       'FUNCTION',
       'VIEW',
       'PROCEDURE',
       'TRIGGER')
   AND status = 'INVALID'
 ORDER BY object_type, object_name;
