首页 > 其他 > 详细

存储过程插入多条数据测试

时间:2020-04-18 18:06:47      阅读:45      评论:0      收藏:0      [点我收藏+]

插入数据

DROP PROCEDURE IF EXISTS test3;
DELIMITER //
create procedure test3()
begin
        DECLARE i int default 12345678;
        DECLARE count int default 0;
while count<1000
        do
        insert into `t_variable` (`Id`,`ConfigId`,`IsPreset`,`Name`,`Type`,`Parameter`,`UpdateTime`,`UpdatedBy`,`GroupId`)
        values (i, 294597245385311360, 0, i, ‘Constant‘, ‘{\"value\":\"234\"}‘, ‘2020-02-11 19:31:44‘, ‘890852000000000050‘, 294849007291729024);
        set count = count + 1;
        set i = i + 1;
end while;
end //

call test3();

删除数据

DROP PROCEDURE IF EXISTS test3;
DELIMITER //
create procedure test3()
begin
        DECLARE i int default 123457;
        DECLARE count int default 0;
while count<1000
        do
        delete from t_variable where ConfigId = 294597245385311360 and Id = i;
        set count = count + 1;
        set i = i + 1;
end while;
end //

call test3();

存储过程插入多条数据测试

原文:https://www.cnblogs.com/tommaoxiaoqi/p/12726775.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!