title: Oracle 11g - FOR loop that inserts only weekdays into a table?
body: <p>I want to insert some data into a table associated with dates for the next year.  I actually only need workdays inserted.  </p>
  
  <pre><code> BEGIN
    FOR i IN 1..365 LOOP
    INSERT INTO MY_TABLE (ID, MY_DATE)
    VALUES (i, (to_date(sysdate,'DD-MON-YY')-1)+i);
    END LOOP;
   END;
  </code></pre>
  
  <p>I can solve my problem by going back and deleting rows that are weekend days, but that seems rather inelegant - can anyone think of a way to modify my loop so that it skips weekends?</p>