Informix Error -4163
-4163 Intrinsic function "name" of class "class" cannot be called directly.
Constructors of the form classname::classname() are invoked through the NEW operator. The classname::!copy() is invoked through the COPY operator. The classname::!derive() is invoked through the AS clause in both the NEW and the COPY operator. Only NewEra returns this error.
Oninit® Troubleshooting Guidance
Reasons / Common Causes
-4163 fires when an intrinsic function is invoked directly — per the official guidance,
classname::classname() constructors are invoked through NEW, classname::!copy() through
the COPY operator, and classname::!derive() through the AS clause in NEW/COPY. Only
NewEra returns this error.
- A constructor called directly instead of through
NEW, per the official guidance — the first named case. !copy()called directly instead of throughCOPY, per the official guidance — the second named case.!derive()called directly instead of through anASclause, per the official guidance — the third named case.
Solutions / Resolution
- Invoke the constructor via
NEW,!copy()viaCOPY, and!derive()viaAS, per the official guidance.
Examples
Calling !copy() directly
LET o2 = Order::!copy(o1)
-- -4163: !copy() must be invoked via the COPY operator
Corrected
LET o2 = COPY o1
Diagnostic Checks
- Check every direct call to an intrinsic function, and replace it with the appropriate
operator (
NEW,COPY, orAS).
Related Errors / Related Topics
- -4151 — "Constructor cannot be called directly." A closely related error, specifically about constructors rather than the full set of intrinsic functions.
An intrinsic function is called directly — use NEW, COPY, or AS instead, per which
intrinsic function it is.