Problems executing a process where I use the loop: REPEAT

0

I have problems executing the following code:

DELIMITER //
CREATE PROCEDURE INFO_LINEAS()
   BEGIN 
             DECLARE contador_fecha INT;
             DECLARE fecha_actual DATE;


                  SET contador_fecha=(SELECT hml_aniomesinfo from cosechas);
             SET fecha_actual= CAST('2016-12-31' as DATE)

             REPEAT 

                  INSERT INTO cosechas (id_ml) values (id_ml);
                  SET contador_fecha=DATE_ADD(contador_fecha,interval 1 month);

             UNTIL contador_fecha= fecha_actual END REPEAT;

DELIMITER ;

CALL INFO_LINEAS();

My intention is to add the number of rows needed to each client until the current date = 201612. But it marks me wrong when executing the program.

    
asked by Angélica 13.12.2016 в 20:49
source

0 answers