This is a read-only copy of the MariaDB Knowledgebase generated on 2024-11-14. For the latest, interactive version please visit https://mariadb.com/kb/.

ITERATE

Sintassi

ITERATE etichetta

Spiegazione

ITERATE può trovarsi solo all'interno di un ciclo LOOP, REPEAT o WHILE. ITERATE significa "ripeti il ciclo", e utilizza le label per determinare quale ciclo deve ripetere.

Esempi

CREATE PROCEDURE esegui_iterate(p1 INT)
BEGIN
  etichetta1: LOOP
    SET p1 = p1 + 1;
    IF p1 < 10 THEN ITERATE etichetta1; END IF;
    LEAVE etichetta1;
  END LOOP etichetta1;
  SET @x = p1;
END
Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party.