Informix Error -4127
-4127 Event expected.
The identifier before the WITH clause of the HANDLE statement does not identify an event. The event must be declared in or inherited by the declared class of the target object (which can be the SELF object).
Oninit® Troubleshooting Guidance
Reasons / Common Causes
-4127 fires when the identifier before a HANDLE statement's WITH clause doesn't identify
an event — per the official guidance, the event must be declared in, or inherited by, the
target object's declared class (which can be SELF).
- The identifier before
WITHisn't a declared event, per the official guidance — the direct, only cause.
Solutions / Resolution
- Confirm the event is declared in, or inherited by, the target object's declared class, per the official guidance.
Examples
A non-event identifier before WITH
HANDLE notAnEvent WITH myHandler
-- -4127: notAnEvent is not declared as an EVENT
Corrected
HANDLE MyEvent WITH myHandler
Diagnostic Checks
- Check whether the identifier before
WITHis declared as anEVENT, and whether it's available on the target object's class (declared or inherited).
Related Errors / Related Topics
- -4126 — "Handler expected." The companion error, about the handler identifier after
WITHrather than the event identifier before it. - -4134 — "Class qualification not allowed when invoking an event." A related event-usage
error, about how an event is invoked rather than whether the
HANDLEidentifier is an event at all.
The identifier before WITH isn't a declared event — check its declaration and availability
on the target object's class.