Oracle has IF/ELSE, CASE, and LOOP and WHILE statements for flow control options.
The LOOP statement in Oracle is similar to the REPEAT statement in MySQL and uses the following syntax:
[label]
LOOP
sql statements go here;
EXIT [label] WHEN condition;
END LOOP;
The WHILE statement in Oracle, which is very similar to the WHILE statement in MySQL, uses the following syntax:
[label]
WHILE condition LOOP
sql statements go here;
END LOOP [label];
For more information about Oracle flow control, take a look at the Further reading section.