1 CREATE DEFINER=`user`@`%` PROCEDURE `create_upload_data`(in start_userid integer,in create_counter integer)
2 BEGIN
3 declare i integer;
4 set i = start_userid;
5 while i < start_userid + create_counter do
6 insert into t_xx_table(column1,column2,column3,column4)
7 select i,column2,column3,column4 from t_xx_table t1 where column1=1814840 and 1 >(
8 select count(*) from t_xx_table where column1=t1.column1 and column2=t1.column2 and column3>t1.column3) ;
9 set i = i+1;
10 end while;
11 END
CREATE DEFINER=`root`@`%` PROCEDURE `delete_user_procedure`(in p_mobile bigint,in p_counter bigint)
BEGIN
DECLARE p_user_id bigint ;
DECLARE i bigint ;
set i = p_mobile;
while i < p_mobile + p_counter do
select id into p_user_id from test.t_user where mobile=p_mobile;
delete from test.t_user_action where user_id=p_user_id;
set i = i + 1 ;
end while;
END
View Code