DELIMITER //
create PROCEDURE updatecatalog()
begin
declare s_id int default 0;
declare r_number bigint default 0;
declare done int default 0;
declare cur cursor for select entity_id,resource_number from res_catalog where entity_id>=1925 and entity_id<=1936; #定义游标,获取数据,准备接下来循环遍历
open cur;
read_loop: LOOP #循环开始
fetch cur into s_id,r_number;
IF done=1 THEN
LEAVE read_loop;
END IF;
update res_catalog set resource_number=CONCAT(r_number,sort) where pid=s_id;
END LOOP read_loop; #循环结束
close cur;
end //
Warning: Undefined variable $uapic in /www/wwwroot/www.murongx.cn/wp-content/themes/kratos-pjax-master/inc/ua.php on line 424
Warning: Undefined variable $uapic in /www/wwwroot/www.murongx.cn/wp-content/themes/kratos-pjax-master/inc/ua.php on line 424
Warning: Undefined variable $uapic in /www/wwwroot/www.murongx.cn/wp-content/themes/kratos-pjax-master/inc/ua.php on line 424
Warning: Undefined variable $uapic in /www/wwwroot/www.murongx.cn/wp-content/themes/kratos-pjax-master/inc/ua.php on line 424
Warning: Undefined variable $uapic in /www/wwwroot/www.murongx.cn/wp-content/themes/kratos-pjax-master/inc/ua.php on line 424