drop function if exists whilefunction // create function whilefunction() returns VARCHAR(20) begin declare l_loop, l_count_2 int default 0; wloop1: while l_loop < 10 do set l_loop := l_loop + 1; if l_loop < 5 then iterate wloop1; end if; set l_count_2 := l_count_2 + 1; end while wloop1; return concat('We looped ',l_loop,' times, but the count was only ',l_count_2); end //