I have the following procedure:
CREATE PROCEDURE incDate(fromdate date, todate date)
SET currDay = fromdate;
SET endDAY = todate;
REPEAT
SET currDay = DATE_ADD(currDay, INTERVAL 1 DAY);
INSERT INTO `dentists`.`dayT` (`day`) VALUES (currDay);
UNTIL currDay > endDAY END REPEAT;
END
But MySQL gives me the following error:
#1193 - Unknown system variable 'currDay'
Why would this be?