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