天天看點

(SQL報錯)DB2 SQL error: SQLCODE: -418, SQLSTATE: 42610, SQLERRMC: null

(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的錯誤資訊中摘出來的。

我覺得是結果集裡的“?”出的問題。