【总账】多账薄科目期初余额引入时报错
金蝶云社区-zhenkai_Weng
zhenkai_Weng
0人赞赏了该文章 516次浏览 未经作者许可,禁止转载编辑于2016年07月26日 12:12:49

问题描述:
多账薄辅助账余额引入完毕后,引入科目期初余额时报中断错
ORA-00001: unique constraint (ZKJT0706.PK_GL_IACCTBAL) violated
错误详细堆栈信息:com.kingdee.bos.BOSException: Sql222 execute exception : insert into T_GL_InitAccountBalance (fbeginbalancefor,fbeginbalancelocal,fbeginbalancerpt,fbeginqty,FYearDebitFor,FYearCreditFor ,FYearDebitLocal ,FYearCreditLocal ,FYearDebitRpt ,FYearCreditRpt,FAccountID,FCurrencyID,FOrgUnitID )
(select sum(b.fbeginbalancefor*av.fdc)*pav.fdc,sum(b.fbeginbalancelocal*av.fdc)*pav.fdc,sum(b.fbeginbalancerpt*av.fdc)*pav.fdc,sum(fbeginqty*av.fdc)*pav.fdc,sum(FYearDebitFor),sum(FYearCreditFor) ,sum(FYearDebitLocal) ,sum(FYearCreditLocal) ,sum(FYearDebitRpt) ,sum(FYearCreditRpt), pav.fid,b.fcurrencyid,b.forgunitid from t_gl_initaccountbalance b
inner join t_bd_accountview av on av.fid = b.faccountid and av.fcompanyid = b.forgunitid
inner join t_bd_accountview pav on (charindex(pav.flongnumber || '!',av.flongnumber)=1 or pav.fid = av.fid) and av.faccounttableid = pav.faccounttableid and av.fcompanyid = pav.fcompanyid
where b.forgunitid =? and av.fisleaf = 1
group by b.forgunitid,pav.fid, pav.fdc, b.fcurrencyid)