I think that you need to create an DB2 SQL stored procedure to use looping.
In that case you can use WHILE,FOR,REPEAT and LOOP.
The FOR approach just iterates over the rowset of a given SQL select.
In the WHILE approach you test a condition , perform an action, increment the counter and loop till the condition reads false.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.