From: (Hal Date: December 27 2011 11:53pm Subject: Re: errors running WHILE loop List-Archive: http://lists.mysql.com/mysql/226516 Message-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" >>>> 2011/12/27 18:13 +0000, Mark Haney >>>> So, what the heck is going on here? I'm at the end of my wits. <<<<<<<< I suspect that you have to make the block delimiter something other than semicolon, and set the block in a routine or trigger. Semicolon terminates SQL routine statements, after PL1. If the block delimiter also is semicolon, parsing the block begins too early. In many examples of routine declaration it is changed to //, or another string not found in the block or routine. I often use question mark, but, of course, that is useless in case of "PREPARE".