r3nder
asked on
create stored proc in sql from mysql
I have a mysql stored procedure I want to turn into a sql stored procedure
how would it be done?
how would it be done?
CREATE PROCEDURE fill_calendar(mystart_date DATE, end_date DATE)
BEGIN
DECLARE crt_date DATE;
DECLARE Yr INT;
DECLARE Mo INT;
SET crt_date = start_date;
SET Yr= Year(mystart_date);
SET Mo= Month(mystart_date);
WHILE crt_date < end_date DO
INSERT INTO calendar(Yr,Mo) VALUES(Yr,Mo);
SET crt_date = DATE_ADD(crt_date, INTERVAL 1 MONTH);
SET Yr= Year(crt_date);
SET Mo= Month(crt_date);
END WHILE;
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER