在运行时,我得到“ ORA-01008 - not all variables bound ” 的 SQL 语句在 TOAD 中运行良好,并且 TOAD(和我)只找到一个参数。
如下所示,查询中只有一个参数。为什么 Oracle 会认为有多个参数/变量并导致抛出异常?
我无法显示真正的 sql,但这是它的传真(列/表名称已更改):
SELECT DECODE(POSTWHEELTYPE,'0','NONE','D','NUMERIC','D','RESTRICTED NEEDLE','X','TRANSFER TO WINTER','A','ACCESS CODE') HALTYPE,
DECODE(VALIDATIONTYPE,'0','NONE','A','FOXPRO CODE','P','PERSONAL CODE','S','RESTRICTED') JBJTYPE,
LAZYNUMBER,
DISPLAYTEXT,
MINLENGTH || '-' || MAXLENGTH LENGTH,
NVL(INSTRUCTIONS, '<NONE>') INSTRUCTIONS
FROM
ABC.CODELAZYS
WHERE
BQSERVERABCID = :ABCID
AND VALIDATIONTYPE <> '0'
ORDER BY
LAZYNUMBER DESC