Informix Error -445: The length of the collation name in the SET COLLATION statement exceeds 32 bytes.
Cause and resolution
The length of the collation name in the SET COLLATION statement exceeds 32 bytes.
The length of the collation name in the SET COLLATION statement cannot exceed 32 bytes.
Oninit® Troubleshooting Guidance
Reasons / Common Causes
-445 is a straightforward identifier-length limit: SET COLLATION requires the collation name to
be 32 bytes or fewer, and the name supplied exceeds that.
- A collation name longer than 32 bytes supplied to
SET COLLATION— the direct, only cause. - A collation name assembled or concatenated programmatically, growing past the limit without an explicit length check.
- Confusion with a different, longer identifier (a full locale string, for example) being used where a shorter, specific collation name is expected.
Solutions / Resolution
- Shorten the collation name to 32 bytes or fewer, per the official guidance.
- Consult the list of valid, supported collation names for the server/locale in use, rather than assembling one from a longer locale string.
- For programmatically constructed collation names, add an explicit length check before
issuing
SET COLLATION.
Examples
Checking a collation name's length before use
-- Confirm the collation name is 32 bytes or fewer before
-- issuing SET COLLATION with it.
SET COLLATION en_us_utf8_ci;
Diagnostic Checks
- Measure the byte length of the collation name being supplied to
SET COLLATION. - Confirm the name is a valid, recognized collation name for the server/locale in use, not a longer, unrelated identifier.
Related Errors / Related Topics
- -354 — "Incorrect database or cursor name format." A related identifier-length/format restriction, in a different context (database/cursor names rather than collation names).
Keep collation names within the 32-byte limit — consult the server's list of valid, supported collation names rather than assembling one from a longer identifier.