2014-07-13 16:37:33
来 源
中存储网
MySQL
create procedure getInfor2()BEGINdeclare _abc varchar(200);declare stopFlag int;DECLARE cursor_name CURSORFORselect zhuanyuan from
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;

声明: 此文观点不代表本站立场;转载须要保留原文链接;版权疑问请联系我们。