DELIMITER $$
CREATE FUNCTION qiuhe
()
RETURNS int(11)
begin
declare sum int default 0;
declare i int default 1;
while i<100 do
set sum=sum+i;
set i=i+1;
end while;
return sum;
end
// select qiuhe() as tju; function
//call qiuhe5(100) procedure