创建定时任务完成:创建ASR识别记录表,每天自动从小云AI对话详情表同步数据。
*/
DROP PROCEDURE IF EXISTS `create_o_asr_record_call`;
DELIMITER ;;
CREATE PROCEDURE `create_o_asr_record_call`(IN `dayInt` bigint,out result int)
COMMENT ‘ASR识别结果表--按日--建表‘
BEGIN
set @sql_tmp3 = CONCAT(‘create table o_asr_record_‘,dayInt,‘ like o_asr_record_0 ‘);
PREPARE stmt3 FROM @sql_tmp3;
EXECUTE stmt3;
DEALLOCATE PREPARE stmt3;
set @engine_tab = CONCAT(‘uc_ipcc_cloud_ai_stat.‘,‘tb_ucpaas_engine_‘,DATE_FORMAT(date_sub(curdate(),interval 1 day),‘%Y%m%d‘));
set @sql_tmp_insert = CONCAT(‘INSERT INTO ‘, CONCAT(‘o_asr_record_‘,dayInt),‘(`callid`,`derial_number`,`content`,`record_url`)‘,‘ select callid,derial_number,text,record_url from ‘, @engine_tab);
PREPARE stmt_insert FROM @sql_tmp_insert;
EXECUTE stmt_insert;
DEALLOCATE PREPARE stmt_insert;
set result = 1;
END
;;
DELIMITER ;
-- 创建定时任务
DELIMITER //
DROP EVENT IF EXISTS event_sync_asr_record//
CREATE EVENT event_sync_asr_record
on schedule EVERY 1 DAY STARTS date_add(curdate(),interval 30 HOUR_MINUTE)
do
BEGIN
call create_o_asr_record_call (DATE_FORMAT(now(),‘%Y%m%d‘),@1);
END//
DELIMITER ;
create_o_asr_record_call
create_o_asr_record_call
---------------------
作者:Jeff.Sheng
来源:CSDN
原文:https://blog.csdn.net/shengqianfeng/article/details/80270695
版权声明:本文为博主原创文章,转载请附上博文链接!
原文地址:https://www.cnblogs.com/HKROnline-SyncNavigator/p/10971498.html