Informix Error -342
-342 Remote host cannot execute statement.
This statement was sent to a database server in a different system for execution. However, that database server does not support the requested function, possibly because it is an earlier version.
Oninit® Troubleshooting Guidance
Reasons / Common Causes
-342 is a distributed-query version-compatibility error: a statement sent to a remote database server for execution uses a feature the remote server's version doesn't support — most commonly because the remote server is running an older Informix version than the local one issuing the statement.
- A distributed query using a newer SQL feature or function not implemented on the remote server's (older) version.
- Version skew across a multi-server topology, where application code was written/tested against the newer server and only later run against an older remote node.
- A feature that's version-gated on both servers independently, where the local server silently accepts the syntax but the remote server, still on an earlier release, rejects it at execution time.
Solutions / Resolution
- Check the remote server's version and compare against the feature/function being used in the statement, per the official guidance.
- Avoid the newer feature for statements that need to run against that remote server, rewriting the query using more broadly compatible syntax.
- Upgrade the remote server if using the newer feature there is a genuine long-term requirement, rather than working around it indefinitely.
Examples
Checking remote server version before using a newer feature
-- Confirm the remote server's version supports the feature in use
-- before relying on it in a distributed query, e.g. via
-- onstat -- version equivalents against the remote node.
Rewriting to avoid an unsupported feature
-- If a newer function isn't available on the remote server,
-- rewrite the distributed portion of the query using more
-- broadly compatible syntax, then apply any newer processing
-- locally on the results instead.
Diagnostic Checks
- Identify the specific feature or function in the statement that's likely unsupported.
- Check the remote server's actual version and compare against that feature's minimum required version.
Related Errors / Related Topics
- -329 — "Database not found or no system permission." Another remote/distributed-database connectivity-related error, though about locating the database rather than feature support once connected.
Version skew across a distributed topology is the most common cause — check the remote server's actual version before assuming the statement itself is wrong.