Informix Error -744
-744 Illegal SQL statement in trigger.
This error is returned when the triggered SQL statement is BEGIN WORK, COMMIT WORK, ROLLBACK WORK, or SET CONSTRAINTS. These statements are not allowed as triggered actions. Remove the offending statement.
Oninit® Troubleshooting Guidance
Reasons / Common Causes
-744 fires when a trigger's triggered action includes BEGIN WORK, COMMIT WORK, ROLLBACK WORK, or SET CONSTRAINTS — per the official guidance, none of these four statements are
allowed as triggered actions, since a trigger fires as part of an already-in-progress statement
and shouldn't control transaction boundaries or constraint-checking mode itself.
- A triggered action including
BEGIN WORK/COMMIT WORK/ROLLBACK WORK, per the official guidance — transaction control belongs to the statement that caused the trigger to fire, not the trigger itself. - A triggered action including
SET CONSTRAINTS, per the official guidance — changing constraint-checking mode mid-trigger isn't supported. - Logic copy-pasted from a standalone SPL routine (where these statements might be legitimate) into a trigger's action, without accounting for the different rules triggers impose.
Solutions / Resolution
- Remove the offending statement, per the official guidance — this is a hard restriction, not something to work around within the trigger itself.
- Move transaction-boundary logic to the application code that issues the statement causing the trigger to fire, rather than inside the trigger.
- If constraint-mode changes are genuinely needed as part of the workflow, issue
SET CONSTRAINTSbefore/after the triggering statement, in application code, rather than inside the trigger's action.
Examples
The disallowed attempt
CREATE TRIGGER trg_orders_insert INSERT ON orders
REFERENCING NEW AS post FOR EACH ROW
(COMMIT WORK, EXECUTE PROCEDURE log_new_order(post.order_id));
-- -744: COMMIT WORK isn't allowed as a triggered action
Corrected — remove it
CREATE TRIGGER trg_orders_insert INSERT ON orders
REFERENCING NEW AS post FOR EACH ROW
(EXECUTE PROCEDURE log_new_order(post.order_id));
Diagnostic Checks
- Scan the trigger's action list for
BEGIN WORK,COMMIT WORK,ROLLBACK WORK, orSET CONSTRAINTS, and remove it, moving any needed transaction/constraint-mode control to the calling application code.
Related Errors / Related Topics
- -675 — "Illegal SQL statement in SPL routine." A related restriction on disallowed
statements in a different context (a routine called from
SELECT) rather than trigger actions.
Four specific statement types are disallowed as triggered actions — move transaction/constraint- mode control to the calling application code instead.