mysql 批量插入过程



create procedure p7()
begin
DECLARE i INT DEFAULT 1;
DECLARE pid INT DEFAULT 17224;
DECLARE file_id INT DEFAULT 92490;
DECLARE attmnt_rel_id INT DEFAULT 104735;
while i <= 10 do
set pid :=pid + 1;
INSERT INTO `ls_prod`(`prod_id`,`t_prod_id`,`sort_id`,`nsort_id`,`sub_nsort_id`,`global_sort`,`global_nsort`,`global_subsort`,`global_brand`,`model_id`,`party_code`,`name`,`prod_en_name`,`price`,`cash`,`inland_price`,`proxy_price`,`carriage`,`tax`,`brief`,`content`,`views`,`praise`,`buys`,`comments`,`rec_date`,`small_pic`,`use_small_pic`,`pic`,`is_commend`,`is_hot`,`status`,`modify_date`,`user_id`,`user_name`,`start_date`,`end_date`,`stocks`,`prod_type`,`key_word`,`attribute`,`parameter`,`user_parameter`,`brand_id`,`actual_stocks`,`reviewScores`,`volume`,`weight`,`transport_id`,`has_invoice`,`has_guarantee`,`after_sale_id`,`stock_counting`,`reject_promise`,`service_guarantee`,`site`,`currency`,`prod_url`,`is_for_trading`,`auxiliaryurl`,`restriction_number`,`rmb_total`,`is_lock`,`is_lock_price`,`site_status`,`rebate_code`,`rebate_url_id`,`is_quickbuy`,`meta_desc`,`meta_keyword`,`meta_title`,`is_self_support`,`release_user`,`outer_url`,`attributes`,`out_stocks`) VALUES
(pid,1,138,740,NULL,NULL,NULL,NULL,NULL,'','','性能测试专用商品','Test Product 123',NULL,0.010,0.00,0.000,0.010,NULL,'','<div align=\'center\'><img alt=\'\' src=\'http://img30.360buyimg.com/jgsq-productsoa/g13/M00/11/02/rBEhVFLPtgwIAAAAAABwO86sYfoAAHzUgGjpUgAAHBT273.jpg\' class=\'err-product\'></div>',227,2,0,14,'2015-01-26 20:21:23','','','g2/M00/00/FD/CgEHc1TPmZWALA-AAAHDql751r0299.jpg','N','N',0,'2015-02-12 22:45:36','402882823a9d5e0d013a9dabe3680002','home',NULL,NULL,4,'P',NULL,NULL,'[{\"key\":\"102\",\"value\":\"保湿补水\"},{\"key\":\"103\",\"value\":\"偏干及干性\"}]',NULL,114,10,5,11.040,0.000,NULL,0,0,NULL,0,NULL,NULL,'www.amazon.com','USD','http://item.jd.com/1057746.html',1,NULL,2,NULL,1,0,0,NULL,NULL,0,NULL,NULL,NULL,0,'',NULL,NULL,NULL);
SET i :=i+1;
INSERT INTO `ls_img_file`(`file_id`,`product_id`,`user_name`,`file_path`,`status`,`upoad_time`,`outer_url`) VALUES (file_id,pid,'home',NULL,1,'2015-05-25 00:00:00','g2/M00/00/FD/CgEHc1TPmZWALA-AAAHDql751r0299.jpg');
SET attmnt_rel_id :=attmnt_rel_id+1;
INSERT INTO `ls_attmnt_rel`(`id`,`attachment_id`,`rel_id`,`rel_object`,`seq`) VALUES (attmnt_rel_id,6364,pid,'P',0);
SET i :=i+1;
end while;
end$
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

annan211

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值