Informix Error -2031: The WORDWRAP attribute can only be specified for CHAR, VARCHAR and TEXT fields.
Cause and resolution
The WORDWRAP attribute can only be specified for CHAR, VARCHAR and TEXT fields.
This PRINT statement applies the WORDWRAP function to a value that is not character data. Check that the field named is the one that you intended, and check the punctuation of the rest of the statement.
Oninit® Troubleshooting Guidance
Reasons / Common Causes
-2031 fires when the WORDWRAP attribute is applied to a field that isn't CHAR, VARCHAR, or
TEXT — per the official guidance, WORDWRAP is restricted to those character-based types.
WORDWRAPspecified for a non-character field (numeric, date, etc.), per the official guidance — the direct, only cause.
Solutions / Resolution
- Verify the correct field name is referenced, per the official guidance, in case
WORDWRAPwas meant for a different, character-typed field. - Check the statement's syntax, per the official guidance, and remove
WORDWRAPif the field genuinely isn'tCHAR/VARCHAR/TEXT.
Examples
WORDWRAP on a non-character field
ATTRIBUTES
total = order_total, WORDWRAP;
-- -2031: order_total is DECIMAL, not CHAR/VARCHAR/TEXT
Corrected
ATTRIBUTES
notes = order_notes, WORDWRAP;
Diagnostic Checks
- Check the declared type of any field using
WORDWRAP, and confirm it'sCHAR/VARCHAR/TEXT.
Related Errors / Related Topics
No closely related error codes are cross-referenced for -2031 in this set yet.
WORDWRAP was applied to a non-character field — confirm the field name, or remove WORDWRAP
if the type genuinely doesn't support it.