(SQL报错)DB2 SQL error: SQLCODE: -418, SQLSTATE: 42610, SQLERRMC: null

本文探讨了在DB2数据库中执行SQL时遇到的SQLCODE -418错误,并分析了该错误的具体原因。文章指出,在使用参数标记(?)时,若未正确设置为预处理语句,则会导致此错误发生。文中还提供了如何修正语法以避免该错误的方法。
(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的错误信息中摘出来的。
我觉得是结果集里的“?”出的问题。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值