从品牌网站建设到网络营销策划,从策略到执行的一站式服务
oracle:
declare
v_num number(8):=0;
BEGIN
FOR i IN (select id from T_BRAND ) LOOP
delete from T_BRAND de where de.id = i.ID;
v_num := v_num+1;
if v_num >=500
then
v_num :=1;
commit;
end if;
END LOOP;
END;
创新互联是专业的双城网站建设公司,双城接单;提供成都做网站、网站建设,网页设计,网站设计,建网站,PHP网站建设等专业做网站服务;采用PHP框架,可快速的进行双城网站开发网页制作和功能扩展;专业做搜索引擎喜爱的网站,专业的做网站团队,希望更多企业前来合作!
mongo:
for (i=0;i<1000000;i++){
db.users.insert(
{
"i":i,
"username":"user"+i,
"age":Math.floor(Math.random()*120),
"create":new Date()
}
);
}
MySQL:
DELIMITER $$
DROP PROCEDURE IF EXISTS prc_insert $$
CREATE PROCEDURE prc_insert
()
BEGIN
set @v_n=1;
while @v_n<1000
do
insert into t(name) values (@v_n);
set @v_n=@v_n+1;
END while ;
END $$
DROP PROCEDURE IF EXISTS prc_delete_aa
;
CREATE DEFINER = root
@%
PROCEDURE prc_delete_aa
()
BEGIN
DECLARE v_err int DEFAULT 1;
DECLARE v_P_POLICYINFO_ID VARCHAR(50);
DECLARE done int;
DECLARE v_count INT DEFAULT 0;
DECLARE cur_aa CURSOR for select P_POLICYINFO_ID from aa;
DECLARE CONTINUE HANDLER FOR NOT FOUND SET done = 1;
DECLARE CONTINUE HANDLER FOR SQLEXCEPTION SET v_err=0;
START TRANSACTION;
OPEN cur_aa;
posLoop:LOOP
IF done=1 THEN
LEAVE posLoop;
END IF;
FETCH cur_aa into v_P_POLICYINFO_ID;
insert into bb select * from aa where aa.P_POLICYINFO_ID = v_P_POLICYINFO_ID;
delete from aa where P_POLICYINFO_ID = v_P_POLICYINFO_ID;
SET v_count = v_count + 1;
IF v_err=0 THEN
ROLLBACK;
ELSE
IF v_count = 1000 THEN
COMMIT;
SET v_count = 0;
END IF;
END IF;
END LOOP posLoop;
commit;
close cur_aa;
end;
成都网站建设公司地址:成都市青羊区太升南路288号锦天国际A座10层 建设咨询028-86922220
成都快上网科技有限公司-四川网站建设设计公司 | 蜀ICP备19037934号 Copyright 2020,ALL Rights Reserved cdkjz.cn | 成都网站建设 | © Copyright 2020版权所有.
专家团队为您提供成都网站建设,成都网站设计,成都品牌网站设计,成都营销型网站制作等服务,成都建网站就找快上网! | 成都网站建设哪家好? | 网站建设地图