This MariaDB tutorial explains how to use the REPEAT statement (REPEAT UNTIL LOOP) in MariaDB with syntax and examples.
In MariaDB, the REPEAT statement is used when you do not know how many times you want the loop body to execute.
The syntax for the REPEAT statement in MariaDB is:
Optional. The name associated with the REPEAT loop.
The statements of code to execute each pass through the REPEAT loop.
The condition that will terminate the REPEAT loop.
Let's look at an example that shows how to use the REPEAT statement in MariaDB:
In this MariaDB LOOP example, the REPEAT statement would repeat the loop until total_value is greater than or equal to 999, at which point the REPEAT loop would be terminated.