|
发表于 2020-7-1 09:46:12
|
显示全部楼层
问题现象:维护BOM完毕,保存时出现“操作失败,已存在相同记录,无法保存
原因: 和最大单据号问题类似,ufsystem..ua_identity中bom表相关行数据不对,因为帐套和ufsystem数据库不同步还原造成的
解决办法:
select max(bomid) from ufdata_002_2014..bom_bom
select max(OpComponentid) from ufdata_002_2014..bom_opcomponent
select max(optionsid) from ufdata_002_2014..bom_opcomponentopt
------------------------------------------------------------------------
update ua_identity set ifatherid=(select max(bomid) from ufdata_998_2011..bom_bom),
ichildid=(select max(bomid) from ufdata_998_2011..bom_bom)
where cacc_id=998 and cvouchtype='bom_bom'
update ua_identity set ifatherid=(select max(optionsid) from ufdata_998_2011..bom_opcomponentopt),
ichildid=(select max(optionsid) from ufdata_998_2011..bom_opcomponentopt)
where cacc_id=998 and cvouchtype='bom_opcomponentopt'
update ua_identity set ifatherid=(select max(OpComponentid) from ufdata_998_2011..bom_opcomponent),
ichildid=(select max(opComponentid) from ufdata_998_2011..bom_opcomponent)
where cacc_id=998 and cvouchtype='bom_opcomponent' |
|