Informix Error -11012: Wrong number of parameters.
Cause and resolution
Wrong number of parameters.
This Informix CLI error code is the same as SQLSTATE value 07001. The following functions can return this error code: SQLExecDirect() and SQLExecute().
The number of parameters that you used SQLBindParameter() to bind is less than the number of parameters in the SQL statement or prepared statement. Bind the same number of parameters as the number of parameters in the statement.
Oninit® Troubleshooting Guidance
Reasons / Common Causes
-11012 fires when SQLExecDirect()/SQLExecute() runs a statement with fewer bound
parameters than the statement requires — per the official guidance, this is the same as
SQLSTATE value 07001.
- Fewer parameters bound via
SQLBindParameter()than the SQL statement/prepared statement actually needs, per the official guidance — the direct, only cause.
Solutions / Resolution
- Bind the same number of parameters as the statement requires, per the official guidance.
Examples
N/A
No specific triggering statement is documented beyond an under-bound parameter count.
Diagnostic Checks
- Count the placeholders in the SQL statement, and confirm the same number of
SQLBindParameter()calls were made before executing.
Related Errors / Related Topics
No closely related error codes are cross-referenced for -11012 in this set yet.
Fewer parameters were bound than the statement requires — bind the correct count via
SQLBindParameter().