title: How to write a stored procedure that recompiles all the PL/SQL packages
body: <p>I am trying to write a stored procedure to recompile all the PL/SQL packages created in DB2. </p>
  
  <p>I have a number of PL/SQL packages in which multiple stored procedures are introduced. e.g., </p>
  
  <pre><code>create or replace package packagename 
  is 
    procedure procedurename; 
  end packagename; 
  </code></pre>
  
  <p>I want to compile these packages from stored procedures in other packages, because there are stored procedures which change table definitions like adding columns to tables, etc. In order to avoid any cache issues, I want them to recompile. </p>
  
  <p>Is there a way to compile such stored procedures programmatically?</p>