The WHILE and LOOP statements are control statements that allow you to execute a list of SQL statements repeatedly while a
search-condition evaluates to TRUE. The LEAVE statement can be used to resume execution at the first statement after the END LOOP.
If the ending statement-label is specified, it must match the beginning statement-label.
The LOOP/END LOOP statement is part of optional SQL/2008 language feature P002, "Computational completeness". In SQL/2008,
the WHILE DO/END WHILE statement is a separate statement that is also part of language feature P002. The syntax combination
WHILE search-condition LOOP supported in SQL Anywhere is a vendor extension.
LOOP is not supported in the Transact-SQL dialect. Looping within Transact-SQL stored procedures is done with the Transact-SQL