Informix Error -767: Cannot UPDATE/INSERT a remote table using views with check options.
Cause and resolution
Cannot UPDATE/INSERT a remote table using views with check options.
You cannot perform an UPDATE or INSERT operation on a table that resides across a network when you are using views that have check options. Remove the all check options from the view, or perform the UPDATE/INSERT locally.
Oninit® Troubleshooting Guidance
Reasons / Common Causes
-767 fires when UPDATE/INSERT is attempted through a view that has WITH CHECK OPTION, where
the view's underlying table lives on a different (remote) database server — per the official
guidance, this combination isn't supported.
UPDATE/INSERTthrough aWITH CHECK OPTIONview over a remote table, per the official guidance — the direct, only cause.- A view originally built for local use, later pointed at a remote table (via a schema or deployment change) without accounting for this restriction.
Solutions / Resolution
- Remove the check option from the view, per the official guidance, if updates/inserts through it against the remote table are still needed.
- Or perform the
UPDATE/INSERTlocally, per the official guidance — connect directly to the server hosting the table (per -556's cross-database write restriction pattern) and modify it there instead of through the remote view. - If the check option's validation is important, replicate its logic in a trigger on the base table (on the server where the table actually lives) instead of relying on the view's check option for a remote write.
Examples
The disallowed attempt
CREATE VIEW local_view_of_remote_orders AS
SELECT * FROM remote_db@remote_server:orders WHERE status = 'active'
WITH CHECK OPTION;
INSERT INTO local_view_of_remote_orders (order_id, status) VALUES (42, 'active');
-- -767: check-option view over a remote table
Corrected — remove the check option
CREATE VIEW local_view_of_remote_orders AS
SELECT * FROM remote_db@remote_server:orders WHERE status = 'active';
INSERT INTO local_view_of_remote_orders (order_id, status) VALUES (42, 'active');
Diagnostic Checks
- Check whether the view has
WITH CHECK OPTIONand whether its underlying table is on a remote server — both conditions together trigger this error.
Related Errors / Related Topics
- -556 — "Cannot create, drop, or modify an object that is external to current database." A related cross-database write restriction, about writing to an external object directly rather than through a check-option view specifically.
Remove the check option, or perform the write locally on the server hosting the actual table.