title: How to update/increment an Oracle sequence by ten million?
body: <p>I have a (Oracle) sequence that I use to assign an order number to new orders being inserted into a database table. It started at 1, and increments by 1 for each new order.</p>
  
  <p>I have a new requirement saying that order numbers should start at 10000000 (ten million), so I want to update all existing records (by adding 10000000; order 1 will then be 10000001, order 7002 will be 10007002, etc), and also increment the Oracle sequence so that the next value will be correct.</p>
  
  <p>I was going to simply run this script:</p>
  
  <pre><code>DECLARE
    l_temp NUMBER;
  BEGIN
    FOR idx IN 1..10000000 LOOP
      SELECT MY_ORDER_SEQ.nextval
        INTO l_temp
        FROM dual
      ;
    END LOOP;
  END;
  /
  </code></pre>
  
  <p>but I don't really know how long that would take to run.</p>
  
  <p>Is there a better way to do this?</p>