I'm trying to insert multiple rows in a table with a while cycle. I already managed to do it by creating a procedure and a delimiter in another version. However, I just want to use this cycle without having the need to create and call a procedure. The code below is giving me a syntax error. How can I do this?
DECLARE i INT DEFAULT 0;
WHILE i < ? DO
INSERT INTO Reservations (Timeslot_idTimeslot, Exam_type_idExam_type, Temp_Student_idStudent, Lock_expiration_date) VALUES (1, 1, 1, '2019-06-06 00:00:00');
SET i = i + 1;
END WHILE;