任务信息同步失败处理

      在录入质量表信息时,任务信息总是录入失败,经过检查操作步骤,得知录入过程中会同时向两个表中插入记录信息,但更新时只更新了其中一个表,导致两个表中数据不平。暂时没有做程序的调整,可以使用下面语句处理该类数据:

     1.查询任务信息:

select wdj.wip_entity_id, we.wip_entity_name
  from wip_discrete_jobs wdj, wip_entities we
 where 1 = 1
   and wdj.wip_entity_id = we.wip_entity_id
   and wdj.organization_id = we.organization_id
   and wdj.organization_id = 103
   and we.wip_entity_name = 'A1321560';

    2.查询出不平的数据信息,并进行数据检查:

select 'XXXXX',
       t.collection_id,
       t.occurrence,
       t.wip_entity_id,
       t.from_op_seq_num,
       t.character7,
       t.character8
  from bosun_qa_results t
 where t.wip_entity_id = 1420234
--and t.from_op_seq_num=any(81,120)
union all
select 'QA',
       qr.collection_id,
       qr.occurrence,
       qr.wip_entity_id,
       qr.from_op_seq_num,
       qr.character7,
       qr.character8
  from qa_results qr
 where qr.wip_entity_id = 1420234;
--and qr.from_op_seq_num=any(81,120);

    3.对XXXXX中的数据进行修改或删除操作,然后在质量模块重新录入数据即可。

猜你喜欢

转载自zhaisx.iteye.com/blog/762006