0

Is there a way to tell a program to move to the next iteration of a while loop in SQL-PL for DB2? I know that there is a CONTINUE statement, but it isn't working for me.

I basically want:

WHILE .... DO
    IF condition_met THEN
        -- Move to next iteration of the while loop
    END IF;
END WHILE;
colmulhall
  • 1,548
  • 3
  • 18
  • 33

1 Answers1

1

Look at the ITERATE command in the Knowledge Center. The ITERATE statement causes the flow of control to return to the beginning of a labelled loop.

proksch_ibm
  • 278
  • 1
  • 9
  • Thanks for your help! The ITERATE command worked for me. I also had to add a LABEL to my while loop so that I could use the ITERATE command. – colmulhall Mar 11 '16 at 09:08