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