create procedure getInfor2()
BEGIN
declare _abc varchar(200);
declare stopFlag int;
DECLARE cursor_name CURSOR
FOR
select zhuanyuan from server;
DECLARE CONTINUE HANDLER FOR NOT FOUND set stopFlag=1;
OPEN cursor_name;
REPEAT
FETCH cursor_name INTO _abc;
begin
if _abc='root'
then
insert t(s1) values(3333);
end if;
end;
UNTIL stopFlag = 1
END REPEAT;
CLOSE cursor_name;
END;
2014-07-13 16:37:33