Informix Error -730
-730 Cannot specify REFERENCING if trigger does not have FOR EACH ROW.
You included a REFERENCING clause in a CREATE TRIGGER statement that does not include a FOR EACH ROW triggered-action section. Either remove the REFERENCING clause or, if it is appropriate, add the missing keywords FOR EACH ROW, followed by the triggered actions that are to occur at that time.
Oninit® Troubleshooting Guidance
Reasons / Common Causes
-730 fires when CREATE TRIGGER includes a REFERENCING clause (naming OLD/NEW correlation
names) without a FOR EACH ROW section — per the official guidance, REFERENCING only makes
sense paired with row-level triggered actions, since it names the specific row's before/after
values.
- A
REFERENCINGclause included on a statement-level trigger (noFOR EACH ROW), per the official guidance — the direct, only cause. - A trigger copied from a row-level template but with the
FOR EACH ROWsection accidentally dropped, leavingREFERENCINGbehind without what it depends on.
Solutions / Resolution
- Remove the
REFERENCINGclause, per the official guidance, if a statement-level trigger (no row-level action) was actually intended. - Or add the missing
FOR EACH ROWkeywords, followed by the triggered actions, per the official guidance, if row-level behavior was actually intended.
Examples
The disallowed combination
CREATE TRIGGER trg_orders_update UPDATE OF status ON orders
REFERENCING NEW AS post
(INSERT INTO audit_log VALUES ('orders updated'));
-- -730: REFERENCING without FOR EACH ROW
Corrected — remove REFERENCING for a statement-level trigger
CREATE TRIGGER trg_orders_update UPDATE OF status ON orders
(INSERT INTO audit_log VALUES ('orders updated'));
Or corrected — add FOR EACH ROW for row-level behavior
CREATE TRIGGER trg_orders_update UPDATE OF status ON orders
REFERENCING NEW AS post FOR EACH ROW
(EXECUTE PROCEDURE log_status_change(post.status));
Diagnostic Checks
- Check whether the
CREATE TRIGGERstatement includes bothREFERENCINGandFOR EACH ROW, or neither — the combination of one without the other is what triggers this error.
Related Errors / Related Topics
- -729 — "Trigger has no triggered action." A related
CREATE TRIGGERstructural error, about a missing action list entirely, rather than aREFERENCING/FOR EACH ROWmismatch.
REFERENCING requires FOR EACH ROW — remove one or add the other, depending on whether
row-level behavior was actually intended.