Informix Error -937: User Defined Routine error.
Cause and resolution
User Defined Routine error.
mi_db_error_raise() has been called from within a user-defined routine and set a fatal error. For an explanation, look at the SQLSTATE that the user-defined routine set.
Oninit® Troubleshooting Guidance
Reasons / Common Causes
-937 fires when mi_db_error_raise() is called from within a user-defined routine (a C UDR)
and sets a fatal error — per the official guidance, the specific reason is carried in the
SQLSTATE the UDR itself set, not in -937's own generic text.
- A C UDR's own logic detecting a condition it considers fatal, per the official guidance,
and raising it via
mi_db_error_raise(). - A UDR from a third-party DataBlade or custom extension encountering an error condition specific to that extension's own logic.
Solutions / Resolution
- Look at the
SQLSTATEthe UDR set, per the official guidance — this is the documented, only path to the specific reason, since -937 itself is a generic wrapper.SQLSTATEis a diagnostic value, not a queryable column: in SQL, retrieve it withGET DIAGNOSTICS; in ESQL/C, it's available directly as the globalSQLSTATEvariable (declared automatically viasqlca.h), not as a member of thesqlcastruct.GET DIAGNOSTICS EXCEPTION 1 :v_sqlstate = RETURNED_SQLSTATE; - Consult the documentation for the specific UDR/DataBlade/extension involved, since the
SQLSTATEvalue's meaning is defined by that extension's own error-handling design, not by the core server.
Examples
Checking SQLSTATE in ESQL/C
EXEC SQL EXECUTE PROCEDURE custom_udr(:arg1);
if (strncmp(SQLSTATE, "00000", 5) != 0) {
printf("SQLSTATE: %s\n", SQLSTATE);
}
Diagnostic Checks
- Capture the
SQLSTATEreported alongside -937, and consult the specific UDR/extension's own documentation for what thatSQLSTATEvalue means.
Related Errors / Related Topics
No closely related error codes are cross-referenced for -937 in this set yet.
A generic wrapper for a UDR's own fatal error — the actual reason lives in the SQLSTATE the
UDR set, documented by that specific UDR/extension.