Informix Error -745: Trigger execution has failed.
Cause and resolution
Trigger execution has failed.
This message is defined for general use to apply to error conditions that you specify in an SPL routine that is a triggered action.
Oninit® Troubleshooting Guidance
Reasons / Common Causes
-745 is a generic, application-defined error: per the official guidance, it's reserved for error
conditions an SPL routine raises itself (via RAISE EXCEPTION) when that routine is running as a
triggered action, and no application-supplied message text was given.
- A triggered SPL routine's own business-logic validation failing, and the routine raising
-745 via
RAISE EXCEPTIONto reject the operation that fired the trigger. RAISE EXCEPTION -745used without a custom message, when the developer wanted a generic failure signal rather than a specific message (compare -746, which carries a custom message string).
Solutions / Resolution
- Trace the failure to the specific triggered SPL routine that raised -745, and review its validation logic to understand what condition it was rejecting.
- Add a custom message via -746 instead, if more specific diagnostic detail would help future
troubleshooting:
RAISE EXCEPTION -746, 0, 'order total must be positive'; - Review the data/operation that triggered the failing routine, since the actual root cause is whatever business rule the routine's own logic enforces — -745 itself carries no information about which rule was violated.
Examples
A trigger raising -745 to reject bad data
CREATE PROCEDURE validate_order_total(p_total DECIMAL)
IF p_total <= 0 THEN
RAISE EXCEPTION -745, 0;
END IF;
END PROCEDURE;
CREATE TRIGGER trg_orders_insert INSERT ON orders
REFERENCING NEW AS post FOR EACH ROW
(EXECUTE PROCEDURE validate_order_total(post.total));
Diagnostic Checks
- Identify the specific triggered SPL routine that raised -745, by reviewing which trigger fired on the failing statement.
- Review that routine's own validation logic to determine the actual business rule that was violated, since -745 alone doesn't specify it.
Related Errors / Related Topics
- -746 — "message-string." The customizable counterpart to this generic trigger-failure error — use it instead when a specific message would help.
A generic application-defined failure signal — trace back to the specific triggered routine's own validation logic for the actual reason.