核算单据成本批量维护报错
金蝶云社区-Jim
Jim
0人赞赏了该文章 741次浏览 未经作者许可,禁止转载编辑于2018年06月12日 21:35:01

查询出现异常。MERGE 语句试图多次更新或删除同一行。目标行与多个源行匹配时会出现这种情况。MERGE 语句无法多次更新/删除目标表的同一行。请简化 ON 子句,以确保目标行最多与一个源行匹配,也可以使用 GROUP BY 子句对源行分组。

MERGE INTO TMP60752C856E4211E8A2020A94EF6 T0 using(SELECT SEQ.FENTRYID, SEQ.FACCTGPRICE, SEQ.FACCTGAMOUNT FROM T_HS_OutInStockSeq seq WHERE seq.FENTRYID IN (SELECT FID FROM @FID_udt1 b) UNION ALL SELECT seqTran.FENTRYID, seqTran.FACCTGPRICE, seqTran.FACCTGAMOUNT FROM T_HS_OutInStockSeq seq INNER JOIN T_HS_OutInStockSeq seqTran ON (((seq.FACCTGID = seqTran.FACCTGID AND seq.FBILLFROMID = seqTran.FBILLFROMID) AND seq.FBILLENTRYID = seqTran.FBILLENTRYID) AND (seq.FENTRYID <> seqTran.FENTRYID)) WHERE (seq.FBILLFROMID = 'STK_TransferDirect' AND seq.FENTRYID IN (SELECT FID FROM @FID1_udt1 b))) T ON (T0.FSEQENTRYID = T.FENTRYID) WHEN MATCHED THEN UPDATE SET T0.FAMOUNT = T.FACCTGAMOUNT, T0.FPRICE = T.FACCTGPRICE;

Server stack trace:
在 Kingdee.BOS.App.Data.AbstractDatabase.ExecuteNonQuery(DbCommand command, IEnumerable`1 listParam)
在 Kingdee.BOS.App.Data.DBUtils.Execute(Context ctx, String strSQL, IEnumerable`1 paramList, Boolean needTranslate)
在 Kingdee.BOS.App.Data.DBUtils.Execute(Context ctx, String strSQL, IEnumerable`1 paramList)
在 Kingdee.K3.FIN.HS.App.Report.HS_HSBillReport.UpdateAmountAfterBillEdit(String tempTable, List`1 seqIds)
在 Kingdee.K3.FIN.HS.App.Report.HS_HSBillReport.GetReportData(String tablename, IRptParams filter)
在 Kingdee.BOS.Core.Report.PlugIn.AbstractSysReportServicePlugIn.GetDataForVirtual(IRptParams filter)
在 Kingdee.BOS.Core.Report.PlugIn.AbstractSysReportServicePlugIn.GetData(IRptParams filter)
在 Kingdee.BOS.App.Core.PlugInProxy.SysReportServicePlugInProxy.GetReportData(ReportServiceParameter parameter)
在 Kingdee.BOS.App.Core.SysReportService.GetReportData(ReportServiceParameter parameter)

Exception rethrown at [0]:
在 System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
在 System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
在 Kingdee.BOS.Contracts.ISysReportService.GetReportData(ReportServiceParameter parameter)
在 Kingdee.BOS.ServiceHelper.SysReportServiceHelper.GetReportData(ReportServiceParameter parameter)
在 Kingdee.BOS.Model.Report.SysReportModel.GetData(Int32 start, Int32 rows)
在 Kingdee.BOS.Web.Report.SysReportView.GetListData()
在 Kingdee.BOS.Web.Report.SysReportView.<>c__DisplayClass55.b__51()