title: Is it possible to Insert appointment date by interval of daily/weekly/monthly
body: <h1 id="insert-appointment-date-by-interval-of-dailyweeklymonthly">Insert  appointment date by interval of daily/weekly/monthly</h1>
  <p>I am new in Apex and I want to do an insert for the follow up doctor visit with intervals of daily/weekly/monthly appointments.</p>
  <p>How should I write this query? Loop? Or is it better to do a pl/sql procedure/function?
  Can you make an example?</p>
  <p>What I want to do :</p>
  <ol>
  <li>Select a start date</li>
  <li>select number of time for the appointments</li>
  <li>Select interval</li>
  <li>Insert/generate appointments automatically in a table</li>
  </ol>
  <p>Example :</p>
  <ul>
  <li><em><strong>Start date</strong></em> : 26-05-2015 (let's suppose 26 is a monday)</li>
  <li><em><strong>Number of appointments</strong></em> : 3</li>
  <li><em><strong>Interval</strong></em> : if <strong>daily</strong>( appointments in the next 3 days (27/28/29) ; if <strong>weekly</strong> (appointments every monday for the next 3 weeks) , if <strong>monthly</strong> (appointment every 26 of the month for the next 3 months)</li>
  <li>press confirm/save/insert in the apex app form and insert in database table.</li>
  </ul>