Informix Error -19827: Cannot create an INSTEAD OF trigger on a table.
Cause and resolution
Cannot create an INSTEAD OF trigger on a table.
You can create an INSTEAD OF trigger on a view only and not on a base table or synonym.
Oninit® Troubleshooting Guidance
Reasons / Common Causes
-19827 fires when CREATE TRIGGER ... INSTEAD OF targets a base table or synonym — per the
official guidance. INSTEAD OF triggers can only be created on views.
INSTEAD OFspecified on a base table or synonym, per the official guidance — the direct, only cause.
Solutions / Resolution
- Create the
INSTEAD OFtrigger on a view instead, per the official guidance.
Examples
An INSTEAD OF trigger on a base table
CREATE TRIGGER mytrig INSTEAD OF INSERT ON mytable ...
Corrected
CREATE TRIGGER mytrig INSTEAD OF INSERT ON myview ...
Diagnostic Checks
- Check whether the
CREATE TRIGGERtarget is a base table/synonym rather than a view.
Related Errors / Related Topics
- -19826 — "Cannot create INSTEAD OF trigger for a select event." A related
INSTEAD OFrestriction, about the triggering event rather than the target object.
INSTEAD OF triggers can only target views, not base tables or synonyms.