Informix Error -4070
-4070 Cannot assign to "SELF".
This statement would assign a new value to the implicit function argument named SELF. Since the value of SELF is used implicitly in any reference to a member of the self object, assignment to it is not permitted.
Oninit® Troubleshooting Guidance
Reasons / Common Causes
-4070 fires when a statement tries to assign a new value to SELF — per the official
guidance, SELF is used implicitly in any reference to a member of the current object, so
assigning to it directly isn't permitted.
- An assignment statement targeting
SELFdirectly, per the official guidance — the direct, only cause.
Solutions / Resolution
- Assign to individual members of
SELFinstead ofSELFitself.
Examples
Assigning directly to SELF
FUNCTION Order()
LET SELF = otherOrder
-- -4070: SELF cannot be assigned a new value
END FUNCTION
Corrected
FUNCTION Order()
LET SELF.order_id = otherOrder.order_id
END FUNCTION
Diagnostic Checks
- Check for any statement assigning directly to
SELF, and rewrite it to assign toSELF's individual members instead.
Related Errors / Related Topics
- -4021 — "A class member cannot be named "SELF"." A related
SELF-identifier restriction, about naming a memberSELFrather than assigning toSELFitself.
A statement tries to assign a new value to SELF directly — assign to its individual members
instead.