Bug #25269 | ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that | ||
---|---|---|---|
Submitted: | 25 Dec 2006 11:18 | Modified: | 25 Dec 2006 11:35 |
Reporter: | Shuja Shuja | Email Updates: | |
Status: | Not a Bug | Impact on me: | |
Category: | MySQL Server: Stored Routines | Severity: | S3 (Non-critical) |
Version: | mysql 5.0.22 | OS: | unix |
Assigned to: | CPU Architecture: | Any |
[25 Dec 2006 11:18]
Shuja Shuja
[25 Dec 2006 11:35]
Valeriy Kravchuk
Thank you for a problem report. Sorry, but it is not a bug. Please, read the manual, http://dev.mysql.com/doc/refman/5.0/en/declare.html, and compare that to your code: declare i int default 0; select count(*) into cnt from mytable; DECLARE cursor1 CURSOR FOR SELECT * from mytable; You have DECLARE, then SQL-statement (SELECT ... INTO), and then DECLARE again! Hence the error message.