0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

負荷テストする時大量データ作成プロシージャ

Last updated at Posted at 2023-01-20

DROP PROCEDURE proc_test01
/
CREATE DEFINER=homestead@% PROCEDURE proc_test01(IN input int(1))
BEGIN
SET @start_idx = 0;
SET @customers_info_id = 100000;
SET @point_card = 7130010000 ;
loop1: LOOP
SET @start_idx = @start_idx + 1;
SET @customers_info_id = @customers_info_id + 1;
SET @point_card = @point_card + 1;
IF @start_idx > input THEN LEAVE loop1;
END IF;

# カード会員情報の登録
insert into DB.table1(card_info_id,customers_info_id,asp_card_main_id,asp_card_sub_id,asp_card_pin_code,my_shop_id,status,disable_flag,created_at,updated_at,last_modifier_id) values (26, CONCAT('90',@customers_info_id  ) , concat(@point_card, @customers_info_id  ) , concat(@point_card, @customers_info_id  ) ,null,0,'1','0',sysdate(),sysdate(),null);
# カード会員情報の登録
insert into DB.table2(customers_info_id ,stamp_id ,disable_flag ,created_at ,updated_at ,last_modifier_id) values (CONCAT('90',@customers_info_id  ) ,1 ,0,sysdate(),sysdate(),null);

END LOOP loop1;
END

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?