Informix Error -4149: Expressions of this type are not allowed in SQL statements.
Cause and resolution
Expressions of this type are not allowed in SQL statements.
An identifier that is mentioned in an SQL statement is of a type such as FOREIGN, or it names an object (a member of a class) or a record.
Oninit® Troubleshooting Guidance
Reasons / Common Causes
-4149 fires when an identifier mentioned in an SQL statement has a type SQL doesn't
support — per the official guidance, this includes FOREIGN-typed identifiers, or identifiers
naming a class object member or a record.
- An identifier of type
FOREIGNused in an SQL statement, per the official guidance — the first named case. - An identifier naming a class object member or a record used in an SQL statement, per the official guidance — the second named case.
Solutions / Resolution
- Use an SQL-compatible scalar type instead of the
FOREIGN/object/record identifier.
Examples
Using a record in an SQL statement
INSERT INTO orders VALUES (rec)
-- -4149: rec is a RECORD, not an SQL-compatible scalar identifier
Corrected
INSERT INTO orders VALUES (rec.order_id, rec.order_date)
Diagnostic Checks
- Check every identifier used in an SQL statement, and confirm none of them are
FOREIGN-typed, class object members, or records.
Related Errors / Related Topics
- -4148 — "CHAR (*) type is not allowed in SQL statements." A related SQL-type
restriction, about
CHAR(*)specifically rather thanFOREIGN/object/record identifiers.
An identifier of an unsupported type (FOREIGN, object member, or record) is used in an SQL
statement — use SQL-compatible scalar values instead.