Informix Error -2940: The column name appears both with and without subscripts.
Cause and resolution
The column name appears both with and without subscripts.
This form displays all of the indicated column, and subscripted portion of it, in different fields. You can display different, subscripted parts of a column in different fields, but the parts cannot overlap. That is, portions of a column cannot be displayed twice on the same screen. Review all uses of the indicated column. Perhaps you did not intend to name it in both places. Perhaps two or more columns of the same name exist in different tables, and you need to use the table name to distinguish them. Otherwise, use nonoverlapping subscripts on each field of the column.
Oninit® Troubleshooting Guidance
Reasons / Common Causes
-2940 fires when a form displays both the whole column and a subscripted portion of the same column in different fields — per the official guidance, displaying different, non-overlapping subscripted parts of a column across different fields is permitted, but portions cannot be displayed twice on the same screen, and an unsubscripted reference implicitly covers the whole column.
- The same column referenced once without subscripts and again with subscripts, per the official guidance — the direct, only cause.
- Two columns of the same name in different tables, referenced without table qualification, per the official guidance — a related cause the guidance calls out explicitly.
Solutions / Resolution
- Review all uses of the indicated column and check whether it was accidentally named in both places, per the official guidance.
- If two same-named columns from different tables were intended, qualify each with its table name, per the official guidance.
- Otherwise, use non-overlapping subscripts on each field of the column, per the official guidance.
Examples
A column shown whole and subscripted
ATTRIBUTES
full_name = name;
initials = name[1,1];
-- -2940: name appears unsubscripted and subscripted
Corrected
ATTRIBUTES
full_name = customer.name;
initials = supplier.name[1,1];
Diagnostic Checks
- Check every field referencing the same column name for a mix of subscripted and unsubscripted uses, and qualify or re-subscript them to remove the overlap.
Related Errors / Related Topics
- -2930 — "Portions of the column name are displayed on the screen more than once." A closely related error, about overlapping subscripted portions of a column rather than an unsubscripted reference overlapping a subscripted one.
- -2950 — "The column name has no section which starts at 1." A related subscripting error, about a missing starting section or 0-based subscripting specifically.
A column is referenced both whole and subscripted, causing overlapping display — qualify by table or use non-overlapping subscripts.