标签:style io os ar for div sp on c
CREATE PROCEDURE proc_variable ()BEGINDECLARE dec_var_ VARCHAR(100);DECLARE rep_num INT;DECLARE dec_var CURSOR for SELECT ID_ FROM ACT_RU_VARIABLE WHERE NAME_ = ‘yjdqsj‘ GROUP BY EXECUTION_ID_ HAVING COUNT(NAME_) >1;OPEN dec_var;REPEATFETCH dec_var INTO dec_var_;DELETE FROM ACT_RU_VARIABLE WHERE ID_ = dec_var_;UNTIL rep_num END REPEAT;CLOSE dec_var;end;
mysql(root@localhost:jjsworkflow)>delimiter // #修改命令终止符为//(random)mysql(root@localhost:jjsworkflow)>CREATE PROCEDURE proc_variable ()-> BEGIN-> DECLARE dec_var_ VARCHAR(100);-> DECLARE rep_num INT;-> DECLARE dec_var CURSOR for SELECT ID_ FROM ACT_RU_VARIABLE WHERE NAME_ = ‘yjdqsj‘ GROUP BY EXECUTION_ID_ HAVING COUNT(NAME_) >1;-> OPEN dec_var;-> REPEAT-> FETCH dec_var INTO dec_var_;-> DELETE FROM ACT_RU_VARIABLE WHERE ID_ = dec_var_;-> UNTIL rep_num END REPEAT;-> CLOSE dec_var;-> end;-> // ##语句最后需要已上面声明的//结尾enter才能被执行
标签:style io os ar for div sp on c
原文地址:http://www.cnblogs.com/rockbes/p/3969786.html