首页 > 代码库 > mysql存储过程批量删除
mysql存储过程批量删除
SP:BEGIN
WHILE instr(_checkstr,_str) <>0 DO
SELECT sortNum INTO @V FROM InApp_job WHERE jobId = substring(_checkstr,1,instr(_checkstr,_str)-1);
DELETE FROM InApp_job WHERE jobId = substring(_checkstr,1,instr(_checkstr,_str)-1);
UPDATE InApp_job SET sortNum=sortNum-1 WHERE sortNum>@V;
SET _checkstr=REPLACE(_checkstr,substring(_checkstr,1,instr(_checkstr,_str)),‘‘);
END WHILE;
SELECT sortNum into @v FROM InApp_job WHERE jobId =_checkstr;
DELETE FROM InApp_job WHERE jobId =_checkstr;
UPDATE InApp_job SET sortNum=sortNum-1 WHERE sortNum >@v;
IF ROW_COUNT() <> 1
THEN
SET _RTN = 1300;
LEAVE SP;
END IF;
SET _RTN = 1;
END
mysql存储过程批量删除
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。