Informix Error -4476: Record members may not be used with database column substring. Possible misspelling or usage of undefined host variables.
Cause and resolution
Record members may not be used with database column substring. Possible misspelling or usage of undefined host variables.
This statement has a reference of the form name1.name2[...]. This is the form in which you would refer to a substring of a column: table.column[...]. However, the names are not a table and column in the database, so 4GL presumes they refer to a field of a record. Inspect the statement and determine what was intended: a reference to a column or to a record. If it is a column reference, verify the names of the table and column in the database. If it is a record reference, verify that the record and component are properly defined. If the record has the same name as a table, prefix the name of the table with @ to make it clear you mean the table, not the record.
Oninit® Troubleshooting Guidance
Reasons / Common Causes
-4476 fires when a name1.name2[...] reference is ambiguous between a column substring
(table.column[...]) and a record field — per the official guidance, since the names don't
resolve to a real table and column, 4GL presumes a record field was intended.
- A
name1.name2[...]reference that's neither a valid table/column pair nor a properly defined record/component, per the official guidance — the direct, only cause.
Solutions / Resolution
- Determine which was intended: a column reference or a record reference, per the official guidance.
- For a column reference, verify the table and column names in the database, per the official guidance.
- For a record reference, verify the record and component are properly defined, per the official guidance.
- If the record shares a name with a table, prefix the table name with
@to disambiguate, per the official guidance.
Examples
Disambiguating a table from a same-named record
LET x = @orders.description[1,10]
-- @ forces "orders" to be read as the database table, not a record
Diagnostic Checks
- Check whether the
name1.name2[...]reference resolves to a real table/column or a properly defined record/component, and use@to disambiguate if a record shares a name with a table.
Related Errors / Related Topics
No closely related error codes are cross-referenced for -4476 in this set yet.
A name1.name2[...] reference is ambiguous between a column substring and a record field —
verify the intended target, using @ to disambiguate a same-named table.