Informix Error -9626: Maximum length should be set for variable-sized opaque types only.
Cause and resolution
Maximum length should be set for variable-sized opaque types only.
When you use the CREATE OPAQUE TYPE statement to define a fixed-length opaque type, you should not specify the maximum length modifier.
Oninit® Troubleshooting Guidance
Reasons / Common Causes
-9626 fires when a CREATE OPAQUE TYPE statement for a fixed-length type also specifies the maximum length modifier — per the official guidance.
- The
maxlengthmodifier specified on a fixed-length opaque type, per the official guidance — the direct, only cause;maxlengthapplies only to variable-length types.
Solutions / Resolution
- Don't specify the maximum length modifier for a fixed-length opaque type, per the official guidance.
Examples
maxlength on a fixed-length type
CREATE OPAQUE TYPE my_type (internallength = 16, maxlength = 32, ...); -- -9626
Corrected
CREATE OPAQUE TYPE my_type (internallength = 16, ...);
Diagnostic Checks
- Check whether the type is fixed-length (
internallength) or variable-length, and removemaxlengthif it's fixed-length.
Related Errors / Related Topics
- -9624 — "Maximum length must be greater than zero and smaller than 32,768." A related CREATE OPAQUE TYPE modifier-validity error, on the value's range rather than its applicability to fixed-length types.
- -9627 — "Passedbyvalue can only be set if length is 1, 2, or 4." A related CREATE
OPAQUE TYPE modifier-validity error, on
passedbyvaluerather thanmaxlength.
The maxlength modifier was specified on a fixed-length opaque type — remove it.