Navicat 下 怎么查看mysql 正在运行的存储过程? 10
3个回答
展开全部
CREATE DEFINER=`root`@`localhost` PROCEDURE `curdemo`()
BEGIN
DECLARE done INT DEFAULT 0;
DECLARE userid,repid INT;
DECLARE cur1 CURSOR FOR select u.userid,u.repid from user u,personalwebsite p where
p.url u.repid and p.distributorid = u.userid
and p.url = u.userid;
DECLARE CONTINUE HANDLER FOR SQLSTATE \'02000\' SET done = 1;
OPEN cur1;
REPEAT
FETCH cur1 INTO userid,repid;
IF NOT done THEN
update personalwebsite set url = repid where distributorid = userid;
END IF;
UNTIL done END REPEAT;
CLOSE cur1;
END;
BEGIN
DECLARE done INT DEFAULT 0;
DECLARE userid,repid INT;
DECLARE cur1 CURSOR FOR select u.userid,u.repid from user u,personalwebsite p where
p.url u.repid and p.distributorid = u.userid
and p.url = u.userid;
DECLARE CONTINUE HANDLER FOR SQLSTATE \'02000\' SET done = 1;
OPEN cur1;
REPEAT
FETCH cur1 INTO userid,repid;
IF NOT done THEN
update personalwebsite set url = repid where distributorid = userid;
END IF;
UNTIL done END REPEAT;
CLOSE cur1;
END;
本回答被网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
应该是navicat里面的函数选项,里面的p()类型的
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询