mysql数据库插入大量数据存储过程
时间:2007-11-24 来源:CU_VIP
-- 插入大量数据
delimiter @@
select 'create procedure auto_insert...'@@
drop procedure if exists auto_insert@@
create procedure auto_insert
(
out result int /*返回状态*/
,out result_str varchar(20) /*返回信息*/
)
begin
declare num varchar(20); set num=0; start_instart:loop
if(num=100) then
begin
leave start_instart;
end;
else
set num=num+1;
call add_token(num,1, 12,'c7acf3148e504f96',@1,@2);
end if;
end loop; set result=1;
set result_str="succeed";
select result, result_str;
end;
@@
delimiter ;
delimiter @@
select 'create procedure auto_insert...'@@
drop procedure if exists auto_insert@@
create procedure auto_insert
(
out result int /*返回状态*/
,out result_str varchar(20) /*返回信息*/
)
begin
declare num varchar(20); set num=0; start_instart:loop
if(num=100) then
begin
leave start_instart;
end;
else
set num=num+1;
call add_token(num,1, 12,'c7acf3148e504f96',@1,@2);
end if;
end loop; set result=1;
set result_str="succeed";
select result, result_str;
end;
@@
delimiter ;
相关阅读 更多 +