Informix Error -4496: CHAR (*) type is not allowed within records or classes.
Cause and resolution
CHAR (*) type is not allowed within records or classes.
The CHAR(*) type is allowed only in function prototypes, as a parameter, not as an element of a record or class.
Oninit® Troubleshooting Guidance
Reasons / Common Causes
-4496 fires when CHAR(*) is used as a record or class member's type — per the official
guidance, CHAR(*) is only allowed in function prototypes, as a parameter type, not as an
element of a record or class.
CHAR(*)used as a record or class member's declared type, per the official guidance — the direct, only cause.
Solutions / Resolution
- Use an explicit
CHARlength instead ofCHAR(*)for the record/class member.
Examples
CHAR(*) as a record member
DEFINE rec RECORD
name CHAR(*)
-- -4496: CHAR(*) is only valid in function prototypes
END RECORD
Corrected
DEFINE rec RECORD
name CHAR(30)
END RECORD
Diagnostic Checks
- Check every record/class member's declared type for
CHAR(*), and give it an explicit length instead.
Related Errors / Related Topics
- -4138 — "Arrays of CHAR(*) are not allowed." A related
CHAR(*)restriction, about array element types rather than record/class members. - -4148 — "CHAR (*) type is not allowed in SQL statements." A related
CHAR(*)restriction, about SQL DDL statements rather than record/class members.
CHAR(*) is used as a record/class member's type, which isn't allowed — give it an explicit
length.