MySQL存储过程跨数据库操作同步数据
telnet不是内部或外部命令BEGIN
DECLARE deliverstatus,smlen,datacoding,total int;
DECLARE tsid,srcaddr,destaddr,servicetype,smcontent,linkid,sequenceno,recvtime,state,resulttime,extcode,applicationid varchar(50) ;
set total = 0;
while total < 20 do
set tsid='';山东蔬菜批发市场
select deliver_status,sm_len,data_coding,to_sp_id,src_addr,dest_addr,service_type,sm_content,link_id,sequence_no,recv_time,state,result_time,extcode_,appli from tlc_to_sp where applicationid_ = 'sms_db' limit 0,1;
if tsid <> '' then
if resulttime <> '' and recvtime <> '' then
营业执照法人变更流程insert into kingterdb.sms_inbox(MASSMSID,SOURCEADDR,RECEIVETIME,MESSAGECONTENT,REQUESTTIME,extcode,applicationid) values(tsid,srcaddr,res elseif resulttime = '' then
insert into kingterdb.sms_inbox(MASSMSID,SOURCEADDR,RECEIVETIME,MESSAGECONTENT,REQUESTTIME,extcode,applicationid) values(tsid,srcaddr,now elseif recvtime = '' then
insert into kingterdb.sms_inbox(MASSMSID,SOURCEADDR,RECEIVETIME,MESSAGECONTENT,REQUESTTIME,extcode,applicationid) values(tsid,srcaddr,res else
insert into kingterdb.sms_inbox(MASSMSID,SOURCEADDR,RECEIVETIME,MESSAGECONTENT,REQUESTTIME,extcode,applicationid) values(tsid,srcaddr,now end if;
insert into tlc_to_sp_his(deliver_status,sm_len,data_coding,to_sp_id,src_addr,dest_addr,service_typ
e,sm_content,link_id,sequence_no,recv_time,state,result_ti end if;
delete from tlc_to_sp where to_sp_id in(select to_sp_id from tlc_to_sp_his where applicationid_ = 'sms_db');
斛珠夫人set total = total + 1;
高倍望远镜黄道吉日2022年11月份查询end while;
END
此存储过程在newppp数据库中插⼊数据到kingterdb数据库的表中。
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。
发表评论