首页 新闻 会员 周边 捐助

ORA-02055:分布式更新操作失效:要求回退:

0
悬赏园豆:20 [已关闭问题] 关闭于 2018-05-03 17:13

db_link mysql。

存储过程如下:

create or replace procedure qgzt_trigger_job is
CURSOR cursor_1 is
       select * from (select * from t_qg_ztry_trigger a 
       left outer join t_qg_ztry b on a.ztryid=b.r_rybh 
       order by a.id
       ) c
       where rownum<=1 and isuse=0;
c_row cursor_1%ROWTYPE;
begin   
  for c_row in cursor_1 loop
      if c_row.state=1 then         
         insert into "wl_national_pursuit"@mysqlodbc values(c_row.r_rybh,c_row.r_xm,c_row.r_bmch,c_row.r_xb,c_row.r_csrq,
         c_row.r_sfzh,c_row.r_hjdxz,c_row.r_xzdxz,c_row.r_sg,c_row.r_ajbh,c_row.r_ajlb,
         c_row.r_tprq,c_row.r_dbjb,c_row.r_tjljb,c_row.r_jj,c_row.r_ladwxc,c_row.r_zbr,c_row.r_lxfs,c_row.r_jyaq,c_row.r_mz);         
      elsif c_row.state=2 then      
         update "wl_national_pursuit"@mysqlodbc set r_rybh=c_row.r_rybh,r_xm=c_row.r_xm,r_bmch=c_row.r_bmch,r_xb=c_row.r_xb,r_csrq=c_row.r_csrq,
         r_sfzh=c_row.r_sfzh,r_hjdxz=c_row.r_hjdxz,r_xzdxz=c_row.r_xzdxz,r_sg=c_row.r_sg, r_ajbh=c_row.r_ajbh,r_ajlb=c_row.r_ajlb,
         r_tprq=c_row.r_tprq,r_dbjb=c_row.r_dbjb,r_tjljb=c_row.r_tjljb,r_jj=c_row.r_jj,r_ladwxc=c_row.r_ladwxc,r_zbr=c_row.r_zbr,
         r_lxfs=c_row.r_lxfs,r_jyaq=c_row.r_jyaq,r_mz=c_row.r_mz where r_rybh=c_row.r_rybh;
      elsif c_row.state=3 then
         delete from "wl_national_pursuit"@mysqlodbc where r_rybh=c_row.r_rybh;
      end if;      
      delete from t_qg_ztry_trigger where id=c_row.id;
      --EXCEPTION 
        --when others then       
         --continue;      
  end loop;
   commit;
  dbms_output.put_line('--------------:'|| 'fish');
end;

存储过程主要用于 联合查询数据,将查到的需要的数据通过判断插入或更新到mysql。然后删除oracle中的其中一张表的数据。执行的时候报ORA-02055:分布式更新操作失效:要求回退的错误,求指导。

问心、的主页 问心、 | 初学一级 | 园豆:94
提问于:2018-03-20 14:30
< >
分享
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册