启用新旧科目对照报错原创
16人赞赏了该文章
117次浏览
编辑于2024年01月19日 14:24:05
1、问题描述
启用新旧科目对照报错,报错堆栈:null
Caused exception message is: Sql1 execute exception : UPDATE t_gl_acctcussent act SET fvchassistrecordid = (SELECT tem.FnewID from VTSDGOTT1O3BI7H8VVHAC2P18QAWI04SE9 tem where tem.FoldId = act.fvchassistrecordid and tem.FnewId is not null ) where fsourcebillid='11111111' and fcompanyid='D9gAAAAAJNDM567U' and fperiodid='D9gAAADpDRWCOIxM'
Caused exception message is: 子查询返回的值不止一个。当子查询跟随在 =、!=、<、<=、>、>= 之后,或子查询用作表达式时,这种情况是不允许的。
2、解决方案
--对照表中存在两条旧科目数据
select FOldAcctID from T_BD_AcctRefContrastentry where FACCTREFCONTRASTID ='替换科目对照表ID' group by FOldAcctID having count(*)>1
处理方案:修改对照表,把查询出来的旧科目对应的记录清空,保存,再重新选新科目保存就可以了
推荐阅读