MYSQL 批量插入

DROP PROCEDURE IF EXISTS per2;
create procedure per2()
begin

declare num int;
declare theme_id int;
declare Category_id int;
declare url_ varchar(100) default 'http://cdn1.yunovo.cn/2018113016460800002/1 _';

set num=1;
set theme_id=1401;
set Category_id=1101;

while num < 107 do
	
	INSERT INTO `clw`.`ocp_theme_info` (`id`, `oneCategory_code`, `category_code`, `name`, `desc`, `theme_pic`, `wallpaper_pic`, `theme_author`, `theme_tag_id`, `device_type`, `skin_version`, `skin_frame_vercode`, `theme_series`, `resolution`, `status`, `belong_org`, `org_code`, `create_by`, `create_datetime`, `update_by`, `update_datetime`) VALUES 
	(theme_id, Category_id, '-1', CONCAT('终端测试类1_',theme_id), 'I am Iron Man!纪念永远的钢铁侠!', CONCAT(url_,num,'_.jpg'), 'http://cdn1.yunovo.cn/doi_common/2019-07-31/2019073117105300000/bg.png', '张强', '', '1', '1.5', '1', '1', '1024x600', '1', '-1', '', 'admin', '2019-07-31 11:40:57', 'admin', '2019-08-19 16:38:36');

	INSERT INTO `clw`.`ocp_theme_res` ( `source_type`, `source_id`, `res_url`, `res_size`, `res_md5`, `create_by`, `create_datetime`, `update_by`, `update_datetime`) VALUES ( '2', theme_id, 'http://cdn1.yunovo.cn/doi_common/2019-07-31/2019073111375600001/1.jpg', '-1', '-1', 'admin', '2019-08-12 20:29:13', 'admin', '2019-08-12 20:29:13');
	INSERT INTO `clw`.`ocp_theme_res` ( `source_type`, `source_id`, `res_url`, `res_size`, `res_md5`, `create_by`, `create_datetime`, `update_by`, `update_datetime`) VALUES ( '1', theme_id, 'http://cdn1.yunovo.cn/doi_common/2019-08-12/2019081220264400037/2019081220264400037.yov', '831621', '01811837f522ae5671a196d40f73afa4', 'admin', '2019-08-12 20:29:13', 'admin', '2019-08-12 20:29:13');
	set num=num+1;
	set theme_id=theme_id+1;

end while;
end;

call per2();

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值