Informix Error -4638: The maximum size for varchar must be between 1 and 255.
Cause and resolution
The maximum size for varchar must be between 1 and 255.
To store strings longer than 255 characters you must use the CHAR data type.
Oninit® Troubleshooting Guidance
Reasons / Common Causes
-4638 fires when a VARCHAR declaration specifies a maximum size outside 1 to 255 — per the
official guidance, strings longer than 255 characters require the CHAR data type instead.
- A
VARCHARsize outside the 1-255 range, per the official guidance — the direct, only cause.
Solutions / Resolution
- Reduce the
VARCHARsize to 255 or fewer, per the official guidance, if that's sufficient. - Use
CHARinstead ofVARCHAR, per the official guidance, for strings longer than 255 characters.
Examples
An oversized VARCHAR
DEFINE notes VARCHAR(500)
-- -4638: VARCHAR's maximum size is 255
Corrected
DEFINE notes CHAR(500)
Diagnostic Checks
- Check every
VARCHARdeclaration's size, and switch toCHARfor anything over 255.
Related Errors / Related Topics
No closely related error codes are cross-referenced for -4638 in this set yet.
A VARCHAR declaration's size is outside 1-255 — use CHAR instead for strings longer than
255 characters.