mysql循環插入數據庫

DROP PROCEDURE IF EXISTS proc_initData;-- 如果存在此存儲過程則刪掉
DELIMITER $
CREATE PROCEDURE proc_initData()
BEGIN
    DECLARE i INT DEFAULT 1;
    WHILE i<=2005 DO
    INSERT INTO 
        `robot_result_detail`( `template_code`, `task_name`, `task_phone_code`, `task_phone_id`, `phone_call_list_id`, `uuid`, `round`,      `messge_id`, `user`, `robot`, `module_name`, `intent_code`, `nlu_intent_code1`, `nlu_intent_confidence1`, `nlu_intent_code2`,          `nlu_intent_confidence2`, `nlu_intent_code3`, `nlu_intent_confidence3`, `regex_intent_code1`, `regex_intent_confidence1`,             `regex_intent_code2`, `regex_intent_confidence2`, `regex_intent_code3`, `regex_intent_confidence3`, `action`, `tag`,                  `create_time`, `modify_time`) 
        VALUES
        ( 'C079_sfzdfhf', 'czyceshi4', 'C079SC20200524004000001', 107874199871197184, 107874350706757632, '123456', 1, '123',  '你好啊' , '我不好', '命中1', 'mingzhong', '123456', 1, '235467', 2, '54366', 3, '25624d', 4, 'asdfgr', 5, 'asgare', 6, '接通',    '是的|凡谷', '2020-05-25 14:07:35', '2020-05-25 14:11:38');
        SET i = i+1;
    END WHILE;
END $
CALL proc_initData();

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章