Informix Error -9627: Passedbyvalue can only be set if length is 1, 2, or 4.
Cause and resolution
Passedbyvalue can only be set if length is 1, 2, or 4.
When you use the CREATE OPAQUE TYPE statement to define a fixed-length opaque type that is passed by value, its internal length must be 1, 2, or 4.
Oninit® Troubleshooting Guidance
Reasons / Common Causes
-9627 fires when a CREATE OPAQUE TYPE statement sets passedbyvalue on a fixed-length type
whose internal length isn't 1, 2, or 4 — per the official guidance.
passedbyvalueset with an internal length other than 1, 2, or 4, per the official guidance — the direct, only cause.
Solutions / Resolution
- Set the internal length to 1, 2, or 4 when the type is passed by value, per the official guidance.
Examples
passedbyvalue with an unsupported length
CREATE OPAQUE TYPE my_type (internallength = 8, passedbyvalue, ...); -- -9627
Corrected
CREATE OPAQUE TYPE my_type (internallength = 4, passedbyvalue, ...);
Diagnostic Checks
- Check the type's
internallengthvalue whenpassedbyvalueis set, and correct it to 1, 2, or 4, or droppassedbyvalue.
Related Errors / Related Topics
- -9623 — "Internal length must be greater than zero and smaller than 32,768." The general internal-length-validity error this is a specific case of, for types passed by value.
- -9626 — "Maximum length should be set for variable-sized opaque types only." A
related CREATE OPAQUE TYPE modifier-validity error, on
maxlengthrather thanpassedbyvalue.
passedbyvalue was set with an internal length other than 1, 2, or 4 — correct the length or
drop passedbyvalue.