This Oracle tutorial explains how to use the REPEAT UNTIL LOOP in Oracle with syntax and examples.
Oracle doesn't have a REPEAT UNTIL LOOP, but you can emulate one with a LOOP statement.
The syntax for emulating a REPEAT UNTIL LOOP in Oracle/PLSQL is:
LOOP
{...statements...}
EXIT [ WHEN <strong>boolean_condition</strong> ];
END LOOP;
The statements of code to execute each pass through the loop.
Optional. It is the condition to terminate the loop.
Let's look at an example of how to emulate a REPEAT UNTIL LOOP in Oracle/PLSQL:
LOOP
monthly_value := daily_value * 31;
EXIT WHEN monthly_value > 4000;
END LOOP;
In this example, we want the loop to repeat until monthly_value is greater than 4000, so we use the EXIT WHEN statement.
EXIT WHEN monthly_value > 4000;
Now, the LOOP would repeat until the monthly_value exceeded 4000.