I want to populate my table "MyDates" with a range of dates as shown in the code below. When I run the code I get this error "Unknown system variable 'dateStart'"
DECLARE
dateStart DATE DEFAULT '2011-01-01';
DECLARE
dateEnd DATE DEFAULT'2011-12-31';
WHILE dateStart<=dateEnd DO
INSERT
INTO
MyDates
(
mydate
)
VALUES
(
dateStart
) ;
SET dateStart=date_add(dateStart,INTERVAL 1 DAY) ;
END WHILE;
END;