Informix Error -11023: String data right truncation.
Cause and resolution
String data right truncation.
This Informix CLI error code is the same as SQLSTATE value 22001. The following function can return this error code: SQLPutData().
Before you called SQLPutData(), SQLGetInfo() returned "Y" when you called it with an information type of SQL_NEED_LONG_DATA_LEN. You then sent more data than the amount that the pcbValue argument specified in SQLBindParameter(). Send only the amount of data that pcbValue specifies.
Oninit® Troubleshooting Guidance
Reasons / Common Causes
-11023 fires when SQLPutData() is sent more data than the bound parameter's length
specifies — per the official guidance, this is the same as SQLSTATE value 22001.
- More data sent to
SQLPutData()than thepcbValueargument specified inSQLBindParameter(), per the official guidance — occurring afterSQLGetInfo()withSQL_NEED_LONG_DATA_LENreturned "Y" — the direct, only cause.
Solutions / Resolution
- Send only the amount of data that
pcbValuespecifies, per the official guidance.
Examples
N/A
No specific triggering statement is documented beyond over-length data sent to
SQLPutData().
Diagnostic Checks
- Check the
pcbValuelength bound viaSQLBindParameter(), and confirm the data passed toSQLPutData()doesn't exceed it.
Related Errors / Related Topics
- -11029 — "String data, length mismatch." The mirror-image error — too little data sent
to
SQLParamData()rather than too much sent toSQLPutData().
More data was sent to SQLPutData() than the bound parameter's length allows — send only the
pcbValue-specified amount.