title: What is the fastest way to populate table with dates after certain day?
body: <p>Let's assume that we have the following input parameters:</p>
  
  <ul>
  <li>date [Date]</li>
  <li>period [Integer]</li>
  </ul>
  
  <p>The task is the following: build the table which has two columns: <em>date</em> and <em>dayname</em>.</p>
  
  <p>So, if we have <code>date</code> = <code>2018-07-12</code> and <code>period</code> = <code>3</code> the table should look like this:</p>
  
  <pre><code>date      |dayname 
  -------------------
  2018-07-12|THURSDAY
  2018-07-13|FRIDAY
  2018-07-14|SATURDAY
  </code></pre>
  
  <p>My solution is the following:</p>
  
  <pre><code> select add_days(date, -1) into previousDay from "DUMMY";
   for i in 1..:period do
       select add_days(previousDay, i) into nextDay from "DUMMY";
       :result.insert((nextDay, dayname(nextDay));
   end for;
  </code></pre>
  
  <p>but I don't like the loop. I assume that it might be a problem in the performance if there are more complicated values that I want to put to result table.</p>
  
  <p><em>What would be the better solution to achieve the target?</em></p>