How to run this MySQL statement?
delimiter |
CREATE PROCEDURE doiterate(p1 INT)
BEGIN
  label1: LOOP
    SET p1 = p1 + 1;
    IF p1 &lt; 10 THEN
      ITERATE label1;
    END IF;
    LEAVE label1;
  END LOOP label1;
END;
|
delimiter ;


If you don't set another delimiter than ; the statement will end at the first ; and your procedure definition will be incomplete. You  need to tell MySQL that the statement should end at the delimiter you defined. After that you can set the delimiter back with delimiter ;