title: ERROR 1064: SQL syntax
body: <p>i want to create a procedure in MySQL/MariaDB, but I get a syntax error which I do not understand.</p>
  
  <pre><code>DELIMITER $$
  DROP PROCEDURE IF EXISTS proc_loop$$;
  CREATE PROCEDURE proc_loop()
  BEGIN
      DECLARE i INT;
      DECLARE j INT;
      DECLARE n INT;
      DECLARE c VARCHAR(3);
      SET i = 1;
      SET j = 1;
      SELECT COUNT(*) INTO n FROM AnswerSets;
      WHILE i &lt; n DO
          WHILE j &lt; 89 DO
              SELECT CONCAT("Q", j) INTO c;
              INSERT INTO T_ANSWER_SET (U_ID, Q_ID, ANSWER) SELECT i, j, c FROM AnswerSets WHERE Id = i;
              SET j = j + 1;
          END WHILE;
          SET i = i + 1;
      END WHILE;
  END$$;
  DELIMITER ;
  </code></pre>
  
  <p>My error message:</p>
  
  <pre><code>ERROR 1064 (42000) at line 16: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ';
  CREATE PROCEDURE proc_loop()
  BEGIN
      DECLARE i INT;
      DECLARE j INT;
      DECLARE n ' at line 1
  </code></pre>
  
  <p>Thanks in advance for help.</p>