[错误排查笔记]SQLCODE=-418, SQLSTATE=42610, SQLERRMC=null
程序员文章站
2022-05-01 19:45:29
近期测试环境中出现错误,详情如下:SQL: INSERT INTO TB_WAS_INST_PROVISION_ACCOUNT (ENTITY_OID, INST_CODE, INST_SIMPLE_NAME,...
近期测试环境中出现错误,详情如下:
SQL: INSERT INTO TB_WAS_INST_PROVISION_ACCOUNT (ENTITY_OID, INST_CODE, INST_SIMPLE_NAME, WAS_NO, QUOTA_MODEL, TOTAL_QUOTA, AVAILABLE_QUOTA, PENDING_QUOTA, CHANNEL_QUOTA, STATIC_LOAN_QUOTA, CURRENT_LOAN_QUOTA, PERMIT_LOAN_QUOTA, INIT_TOTAL_QUOTA, INIT_PENDING_QUOTA, INIT_CHANNEL_QUOTA, INIT_AVAILABLE_QUOTA, INIT_LOAN_QUOTA, WAS_DATE, STATUS, CREATE_TIME, LAST_MODIFY_TIME) SELECT S_TB_WAS_INST_PROVISION_ACCOUNT.NEXTVAL, ?, ?, ?, ‘0’, 0, 0, 0, 0, 0, 0, 99999999999999, 0, 0, 0, 0, 0, ?, ‘00’, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP FROM SYSIBM.DUAL WHERE NOT EXISTS( SELECT 1 FROM TB_WAS_INST_PROVISION_ACCOUNT WHERE INST_CODE = ? AND WAS_DATE = ? )
Cause: com.ibm.db2.jcc.am.SqlSyntaxErrorException: DB2 SQL Error: SQLCODE=-418, SQLSTATE=42610, SQLERRMC=null, DRIVER=4.16.53
; bad SQL grammar []; nested exception is com.ibm.db2.jcc.am.SqlSyntaxErrorException: DB2 SQL Error: SQLCODE=-418, SQLSTATE=42610, SQLERRMC=null, DRIVER=4.16.53
出错数据库为DB2/LINUXX8664 9.5.5
该语句直接执行可直接通过,在DB2/LINUXX8664 9.7.11版本也无问题,仅V9.5版本出现该问题,最后使用’${paramName}'替换了#{paramName}解决了该问题,即用参数注入方式替换编译出来的?,猜测可能是数据库版本低不支持该参数使用方式。
本文地址:https://blog.csdn.net/jiangbian45/article/details/107665320
上一篇: 视频存储
下一篇: 达梦数据库DCA培训学习