drop function if exists whilefunction // create function whilefunction() returns VARCHAR(20) begin declare l_loop int default 0; while l_loop < 10 do set l_loop := l_loop + 1; end while; return concat('We looped ',l_loop,' times'); end //