(SQL报错)DB2 SQL error: SQLCODE: -418, SQLSTATE: 42610, SQLERRMC: null
db中执行没问题,java调用执行的时候报错。
百度得答案:
结果集里,不能传参数
Parameter markers can never be used:
* in a statement that is not a prepared statement
* in the fullselect of a CREATE VIEW statement
* in the triggered action of a CREATE TRIGGER statement
* in a query captured by DB2 Query Patroller
The statement cannot be processed.
User Response: Correct the syntax of the statement. If untyped parameter markers are not allowed, use the CAST specification to give the parameter marker a data type.
这是DB2的错误信息中摘出来的。
我觉得是结果集里的“?”出的问题。
db中执行没问题,java调用执行的时候报错。
百度得答案:
结果集里,不能传参数
Parameter markers can never be used:
* in a statement that is not a prepared statement
* in the fullselect of a CREATE VIEW statement
* in the triggered action of a CREATE TRIGGER statement
* in a query captured by DB2 Query Patroller
The statement cannot be processed.
User Response: Correct the syntax of the statement. If untyped parameter markers are not allowed, use the CAST specification to give the parameter marker a data type.
这是DB2的错误信息中摘出来的。
我觉得是结果集里的“?”出的问题。
本文探讨了在DB2数据库中执行SQL时遇到的SQLCODE -418错误,并分析了该错误的具体原因。文章指出,在使用参数标记(?)时,若未正确设置为预处理语句,则会导致此错误发生。文中还提供了如何修正语法以避免该错误的方法。
DB2 SQL error: SQLCODE: -418, SQLSTATE: 42610, SQLERRMC: null&spm=1001.2101.3001.5002&articleId=83852173&d=1&t=3&u=db3624d6504e453a99fa21992bab0f72)
5612

被折叠的 条评论
为什么被折叠?



