I am working on an Attendance project, and this table holds the status of the employee for every month (Permission, Missed, Late etc.). By default, it has be 'Yet to Attend'. I am feeding records into the database for the entire year. Here is my code :
use attendance;
drop procedure setDefault;
DELIMITER $$
create procedure setDefault()
BEGIN
DECLARE theDate date;
set @theDate = '2020-01-25';
while theDate < '2021-01-24' DO
INSERT INTO Attendance.empStatus VALUES('4' , theDate , 'YET TO ATTEND');
set @theDate = @theDate+1;
end while;
end $$
DELIMITER
call setDefault();
Ps. '4' is the employee id.
Issue is that this is not getting executed. The 'CREATE PROCEDURE...' line is executed, after which it skips to the call line but I don't know why.