MERGE INTO TEMP_DATA od USING
(SELECT ? col1, ? col2 FROM DUAL) incoming
ON (od.TEMP_13 = incoming.col1)
WHEN NOT MATCHED THEN
INSERT (od.TEMP_13, od.PAGE_COUNT)
VALUES ( incoming.col1, incoming.col2)
如果我们为PAGE_COUNT
传递空值,则此错误即将发生。我们可以更改上面的SQL语句,就像传递空值然后设置默认值'0'一样?
对于TEMP_13的SQLException:123456789--来自DB的错误 - 缺少IN 或者索引:: 2的OUT参数
答案 0 :(得分:0)
使用下面的SQL,我试过它对我有用......
MERGE INTO TEMP_DATA od USING
(SELECT ? col1, nvl(null,0) col2 FROM DUAL) incoming
ON (od.TEMP_13 = incoming.col1)
WHEN NOT MATCHED THEN
INSERT (od.TEMP_13, od.PAGE_COUNT)
VALUES ( incoming.col1, incoming.col2)