The following example shows a valid use of LEAVE with an iteration statement:
LABEL1: WHILE i < 10 DO UPDATE table_1 SET table_1.column_1 = i WHERE table_1.column_2 > 10; IF ACTIVITY_COUNT > 1 THEN LEAVE LABEL1; END IF; SET i = i+1; END WHILE LABEL1;