WHILE
Sintassi
[etichetta_begin:] WHILE condizione DO
lista_istruzioni
END WHILE [etichetta_end]
Spiegazione
Le istruzioni che si trovano all'interno di un ciclo WHILE vengono eseguite ripetutamente finché condizione è True. lista_istruzioni consiste di una o più istruzioni.
Le istruzioni WHILE possono avere un'etichetta. etichetta_end può essere specificata solo se è presente anche etichetta_end. Se ci sono entrambe, devono essere uguali.
Esempi
CREATE PROCEDURE esegui_while() BEGIN DECLARE v1 INT DEFAULT 5; WHILE v1 > 0 DO ... SET v1 = v1 - 1; END WHILE; END
Commenti
Sto caricando i commenti......
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.