核算维度明细账查询报错
598次浏览
编辑于2017年06月07日 16:57:26
查询出现异常。MERGE 语句试图多次更新或删除同一行。目标行与多个源行匹配时会出现这种情况。MERGE 语句无法多次更新/删除目标表的同一行。请简化 ON 子句,以确保目标行最多与一个源行匹配,也可以使用 GROUP BY 子句对源行分组。
MERGE INTO TMP38C5361B4B5F11E78032E644C3E B
USING TMP38C536204B5F11E78032E644C3E E
ON (B.FACCOUNTBOOKID = E.FACCOUNTBOOKID AND B.FYEAR = E.FYEAR AND B.FPERIOD = E.FPERIOD
AND B.FADJUSTPERIOD = E.FADJUSTPERIOD AND B.FACCOUNTID = E.FACCOUNTID AND B.FDETAILID = E.FDETAILID AND B.FCURRENCYID = E.FCURRENCYID)
WHEN MATCHED THEN
UPDATE
SET B.FBEGINQTY= B.FBEGINQTY + E.FBEGINQTY,
B.FBEGINBASEUNITQTY= B.FBEGINBASEUNITQTY + E.FBEGINBASEUNITQTY,
B.FDEBITQTY= B.FDEBITQTY + E.FDEBITQTY,
B.FDEBITBASEUNITQTY= B.FDEBITBASEUNITQTY + E.FDEBITBASEUNITQTY,
B.FCREDITQTY= B.FCREDITQTY + E.FCREDITQTY,
B.FCREDITBASEUNITQTY= B.FCREDITBASEUNITQTY + E.FCREDITBASEUNITQTY,
B.FYTDDEBITQTY = B.FYTDDEBITQTY + E.FYTDDEBITQTY,
B.FYTDDEBITBASEUNITQTY = B.FYTDDEBITBASEUNITQTY + E.FYTDDEBITBASEUNITQTY,
B.FENDQTY= B.FENDQTY + E.FENDQTY,
B.FENDBASEUNITQTY= B.FENDBASEUNITQTY + E.FENDBASEUNITQTY,
B.FYTDCREDITQTY= B.FYTDCREDITQTY + E.FYTDCREDITQTY,
B.FYTDCREDITBASEUNITQTY=B.FYTDCREDITBASEUNITQTY + E.FYTDCREDITBASEUNITQTY;
Server stack trace:
在 Kingdee.K3.FIN.GL.App.Core.AbstractVoucherPost.PostVoucher(Context ctx, VoucherPostParameters postParam)
在 Kingdee.K3.FIN.GL.App.Core.AbstractVoucherPost.Post(Context ctx, VoucherPostParameters postParam)
在 Kingdee.K3.FIN.GL.App.Core.VirtualVoucherPost.VirtualPostVoucherContainQty(Context ctx, VoucherPostParameters postParam)
在 Kingdee.K3.FIN.GL.App.Report.SubledgerForAcctItemsService.SetValue(DynamicObject obj)
在 Kingdee.K3.FIN.GL.App.Report.SubledgerForAcctItemsService.Paging(IRptParams filter)
在 Kingdee.K3.FIN.GL.App.Report.SubledgerForAcctItemsService.GetList(IRptParams filter)
在 Kingdee.BOS.Core.Report.PlugIn.AbstractSysReportServicePlugIn.GetListAndReportData(IRptParams filter)
在 Kingdee.BOS.App.Core.PlugInProxy.SysReportServicePlugInProxy.GetListAndReportData(MoveReportServiceParameter parameter)
在 Kingdee.BOS.App.Core.SysReportService.GetListAndReportData(MoveReportServiceParameter 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.GetListAndReportData(MoveReportServiceParameter parameter)
在 Kingdee.BOS.ServiceHelper.SysReportServiceHelper.GetListAndReportData(MoveReportServiceParameter parameter)
在 Kingdee.BOS.Model.Report.MoveReportModel.GetData(Int32 start, Int32 rows)
在 Kingdee.BOS.Web.Report.SysReportView.GetListData()
在 Kingdee.BOS.Web.Report.SysReportView.<>c__DisplayClass4d.b__49()
MERGE INTO TMP38C5361B4B5F11E78032E644C3E B
USING TMP38C536204B5F11E78032E644C3E E
ON (B.FACCOUNTBOOKID = E.FACCOUNTBOOKID AND B.FYEAR = E.FYEAR AND B.FPERIOD = E.FPERIOD
AND B.FADJUSTPERIOD = E.FADJUSTPERIOD AND B.FACCOUNTID = E.FACCOUNTID AND B.FDETAILID = E.FDETAILID AND B.FCURRENCYID = E.FCURRENCYID)
WHEN MATCHED THEN
UPDATE
SET B.FBEGINQTY= B.FBEGINQTY + E.FBEGINQTY,
B.FBEGINBASEUNITQTY= B.FBEGINBASEUNITQTY + E.FBEGINBASEUNITQTY,
B.FDEBITQTY= B.FDEBITQTY + E.FDEBITQTY,
B.FDEBITBASEUNITQTY= B.FDEBITBASEUNITQTY + E.FDEBITBASEUNITQTY,
B.FCREDITQTY= B.FCREDITQTY + E.FCREDITQTY,
B.FCREDITBASEUNITQTY= B.FCREDITBASEUNITQTY + E.FCREDITBASEUNITQTY,
B.FYTDDEBITQTY = B.FYTDDEBITQTY + E.FYTDDEBITQTY,
B.FYTDDEBITBASEUNITQTY = B.FYTDDEBITBASEUNITQTY + E.FYTDDEBITBASEUNITQTY,
B.FENDQTY= B.FENDQTY + E.FENDQTY,
B.FENDBASEUNITQTY= B.FENDBASEUNITQTY + E.FENDBASEUNITQTY,
B.FYTDCREDITQTY= B.FYTDCREDITQTY + E.FYTDCREDITQTY,
B.FYTDCREDITBASEUNITQTY=B.FYTDCREDITBASEUNITQTY + E.FYTDCREDITBASEUNITQTY;
Server stack trace:
在 Kingdee.K3.FIN.GL.App.Core.AbstractVoucherPost.PostVoucher(Context ctx, VoucherPostParameters postParam)
在 Kingdee.K3.FIN.GL.App.Core.AbstractVoucherPost.Post(Context ctx, VoucherPostParameters postParam)
在 Kingdee.K3.FIN.GL.App.Core.VirtualVoucherPost.VirtualPostVoucherContainQty(Context ctx, VoucherPostParameters postParam)
在 Kingdee.K3.FIN.GL.App.Report.SubledgerForAcctItemsService.SetValue(DynamicObject obj)
在 Kingdee.K3.FIN.GL.App.Report.SubledgerForAcctItemsService.Paging(IRptParams filter)
在 Kingdee.K3.FIN.GL.App.Report.SubledgerForAcctItemsService.GetList(IRptParams filter)
在 Kingdee.BOS.Core.Report.PlugIn.AbstractSysReportServicePlugIn.GetListAndReportData(IRptParams filter)
在 Kingdee.BOS.App.Core.PlugInProxy.SysReportServicePlugInProxy.GetListAndReportData(MoveReportServiceParameter parameter)
在 Kingdee.BOS.App.Core.SysReportService.GetListAndReportData(MoveReportServiceParameter 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.GetListAndReportData(MoveReportServiceParameter parameter)
在 Kingdee.BOS.ServiceHelper.SysReportServiceHelper.GetListAndReportData(MoveReportServiceParameter parameter)
在 Kingdee.BOS.Model.Report.MoveReportModel.GetData(Int32 start, Int32 rows)
在 Kingdee.BOS.Web.Report.SysReportView.GetListData()
在 Kingdee.BOS.Web.Report.SysReportView.<>c__DisplayClass4d.
推荐阅读