0

I am using DBeaver and here is the code of mysql procedure:

drop procedure if exists transfertweets;
create procedure transfertweets()
BEGIN
set @id_lower = 13505;
set @id_end = 14118801;
set @batch = 6;
set @id_upper = 13505;
while @id_lower < @id_end DO
end while;
END

Problem is that whenever I add this while loop it gives me error given in image. If I remove this while loop it runs perfectly. It's bugging me now.Thanks in advance enter image description here

Anonymous
  • 93
  • 2
  • 9
  • consider enclosing your condition within '()' brackets... – RohitS Nov 05 '16 at 13:09
  • Already did, not worked. By the way I am using mysql 5.1.39. – Anonymous Nov 05 '16 at 13:13
  • might be delimiter problem try with this thread....http://stackoverflow.com/questions/25514175/error-using-while-loop-in-mysql-query – RohitS Nov 05 '16 at 13:21
  • I've tried it too. Still error with while loop. – Anonymous Nov 05 '16 at 13:29
  • Your while loop triggers an infinite loop. You have no condition to increment `@id_lower` within your loop. Here's the [while syntax](https://dev.mysql.com/doc/refman/5.7/en/while.html) you should be following – R T Nov 05 '16 at 13:56

0 Answers0