DELIMITER $$
CREATE PROCEDURE pro_insert(IN maxNum INT)
BEGIN
DECLARE i INT DEFAULT(1);
while i<=maxNum DO
UPDATE `yyl_people_registration` SET `STATUS`=2 ,examine_desc='请核对身份证号' WHERE id_card = (SELECT id_card FROM ldrk WHERE id = i);
SET i=i+1;
END WHILE;
END $$
DELIMITER ;
CALL pro_insert(4831);
DROP PROCEDURE pro_insert --删除方法