title: How to use while loop for the date in mysql stored procedure and insert records into database
body: <p>I want add the records as a single row in the database from FROMDATE to TODATE.but the problem is it only insert record for one month...</p>
  
  <p>CREATE DEFINER=<code>root</code>@<code>localhost</code> PROCEDURE <code>addCalendar</code>(IN <code>INPFROMDATE</code> DATE, IN <code>INPTODATE</code> DATE)
       NO SQL</p>
  
  <pre><code>BEGIN
  
  DECLARE SFROMDATE DATE;
  DECLARE STODATE DATE;
  SET SFROMDATE=INPFROMDATE;
  SET STODATE=INPTODATE;
  
  WHILE SFROMDATE&lt;=STODATE
  DO
  
  INSERT INTO CALENDER VALUES(SFROMDATE,STODATE);
  SET SFROMDATE=SFROMDATE+1;
  END WHILE;
  END
  </code></pre>