Informix Error -2045
-2045 The conditional attributes of a 4GL field cannot depend
on the values of other fields.The Boolean expression in a WHERE clause of a COLOR attribute can use only the name of that field and constants. Revise this attribute, and recompile the form.
Oninit® Troubleshooting Guidance
Reasons / Common Causes
-2045 fires when a COLOR attribute's WHERE clause references a field other than the one it
applies to — per the official guidance, the Boolean expression in a COLOR attribute's WHERE
clause can only use that field's own name and constants.
- A
COLORattribute'sWHEREclause referencing a different field, per the official guidance — the direct, only cause.
Solutions / Resolution
- Revise the problematic attribute and recompile the form, per the official guidance —
rewrite the
WHEREclause to reference only the field's own name and constants.
Examples
A COLOR condition referencing another field
ATTRIBUTES
status = order_status,
COLOR = "red" WHERE priority = "high";
-- -2045: the condition references priority, not status
Corrected
ATTRIBUTES
status = order_status,
COLOR = "red" WHERE status = "cancelled";
Diagnostic Checks
- Check every
COLORattribute'sWHEREclause for a reference to a field other than the one the attribute applies to.
Related Errors / Related Topics
- -2021 — "An illegal color has been specified." A related
COLOR-attribute error, about an invalid color name rather than a cross-field condition. - -2044 — "At most one color attribute may be specified for each field with each
condition." A related
COLOR-attribute error, about duplicate specifications.
A COLOR attribute's condition referenced a different field — rewrite it to reference only its
own field and constants.