NewbiDoobie
Technical User
I am writing this stored procedure and it keeps erroring out:
the error I keep getting is:
Failed to execute SQL : SQL create procedure RetensionRate () BEGIN CREATE TEMPORARY TABLE mytemptable (Week int, beginning_Count bigint, Ending_Count bigint, Retension_Rate decimal); insert into mytemptable select Week, Beginning_Count,Ending_Count, Retension_Rate * 100 from RetensionSummary order by week; select * from mytemptable; END failed : You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'CREATE TEMPORARY TABLE mytemptable (Week int, beginning_Count bigint, Ending_Co' at line 1
This seems to happen every time I use a begin and end statement as the statements run fine until I try to place this into a procedure
Code:
create procedure RetensionRate ()
BEGIN
CREATE TEMPORARY TABLE mytemptable (Week int, beginning_Count bigint, Ending_Count bigint, Retension_Rate decimal);
insert into mytemptable select Week, Beginning_Count,Ending_Count, Retension_Rate * 100 from RetensionSummary order by week;
select * from mytemptable;
END
the error I keep getting is:
Failed to execute SQL : SQL create procedure RetensionRate () BEGIN CREATE TEMPORARY TABLE mytemptable (Week int, beginning_Count bigint, Ending_Count bigint, Retension_Rate decimal); insert into mytemptable select Week, Beginning_Count,Ending_Count, Retension_Rate * 100 from RetensionSummary order by week; select * from mytemptable; END failed : You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'CREATE TEMPORARY TABLE mytemptable (Week int, beginning_Count bigint, Ending_Co' at line 1
This seems to happen every time I use a begin and end statement as the statements run fine until I try to place this into a procedure