Informix Error -1132
-1132 The destination string of the CONSTRUCT statement is not large enough.
The outcome of a CONSTRUCT statement is a character string that contains all the conditions that the user entered. This string is in a form suitable for use as the WHERE clause of a SELECT statement. In this CONSTRUCT statement, the result string is longer than the program variable that is specified to receive it. As a general rule, the length of the variable must allow enough room for the names of all the screen fields that are used in the statement, plus room for the field contents and for punctuation and relational operators. Review the statement, and revise the definition of the receiving variable accordingly.
Oninit® Troubleshooting Guidance
Reasons / Common Causes
-1132 fires when CONSTRUCT produces a character string (the user-entered conditions for a
WHERE clause) longer than the receiving program variable can hold — per the official guidance,
the destination variable needs room not just for field names and their values, but also for the
operators and punctuation CONSTRUCT adds between them.
- A receiving variable sized only for the expected field values, per the official
guidance — not accounting for the additional characters
CONSTRUCTadds for operators (=,>,BETWEEN,AND, etc.) and punctuation. - A user entering conditions on many fields at once, producing a longer combined string than a variable sized for simpler, single-field queries can hold.
Solutions / Resolution
- Size the receiving program variable generously, per the official guidance, accounting for
field names, their entered contents, and the operators/punctuation
CONSTRUCTinserts between conditions.
Examples
An undersized destination variable
DEFINE v_where CHAR(30);
CONSTRUCT v_where ON order_id, status, order_date FROM s_order.*
END CONSTRUCT
-- -1132: the combined WHERE-clause string exceeds 30 characters
Corrected — a wider variable
DEFINE v_where CHAR(200);
CONSTRUCT v_where ON order_id, status, order_date FROM s_order.*
END CONSTRUCT
Diagnostic Checks
- Estimate the worst-case length of the constructed
WHERE-clause string — every field name, its entered value, and the connecting operators/punctuation — and size the destination variable accordingly.
Related Errors / Related Topics
No closely related error codes are cross-referenced for -1132 in this set yet.
The CONSTRUCT destination variable is too small for the combined condition string — widen it,
accounting for operators and punctuation as well as the field values themselves.