title: Oracle table with backup data
body: <p>I have a package which I call like this:</p>
  <pre><code>BEGIN
      package.sp1();
      package.sp2();
  END;
  </code></pre>
  <p>During this execution, a table is updated in procedures sp1 and sp2. However, I need to store a copy of that table as it was originally just in case something goes wrong and I need to restore the previous data. The data would only be copied on the first execution of each day. Then, the next day, the copied data would be used as a starting point to be updated in procedures sp1 and sp2.</p>
  <p>How can I do that in another procedure?</p>
  <p>This is what I want to do in pseudo-code:</p>
  <pre><code>BEGIN
      -- Fetch the data copied in yesterday's first execution
          package.sp1(); -- Updates the table
          package.sp2(); -- Also updates the table
      -- Store the updated data if this is the first execution of the day
  END;
  </code></pre>