The Syntax for a Simulated REPEAT...UNTIL Loop
LOOP <statements> IF <condition is true> EXIT; END IF; END LOOP;
Alternatively, you could use the preferable method of
LOOP <statements> EXIT WHEN <condition is true>; END LOOP;