Informix Error -570: Cannot reference an external ANSI database.
Cause and resolution
Cannot reference an external ANSI database.
This statement refers to a database other than the current database. However, the current database is not ANSI compliant, and the external one is. This action is not supported; the databases that are used in a single transaction must all be ANSI compliant, or all must not be.
Oninit® Troubleshooting Guidance
Reasons / Common Causes
-570 fires when a statement in a non-ANSI-compliant current database references an external database that is ANSI-compliant — per the official guidance, all databases participating in a single transaction must either all be ANSI-compliant or all not be, the same family of consistency restrictions as -568/-569's logging-mode rule.
- A cross-database reference from a non-ANSI database to an ANSI-compliant one, per the official guidance — the direct, only cause.
- A database created with
MODE ANSI(which also implies logging) being referenced from an ordinary non-ANSI application database within the same transaction. - A database's ANSI-compliance mode assumed to match another's, without checking, when writing cross-database SQL spanning the two.
Solutions / Resolution
- Restructure the operation to avoid a same-transaction cross-database reference between databases with different ANSI-compliance modes, per the official guidance's underlying requirement.
- Move data between the databases via unload/load instead of an in-transaction cross-database reference, if both databases' ANSI-compliance modes are intentional and fixed.
- Check a database's ANSI-compliance mode before writing cross-database SQL against it:
SELECT name, is_ansi FROM sysmaster:sysdatabases WHERE name = 'target_db';
Examples
The disallowed cross-database reference
DATABASE ordinary_db; -- not ANSI-compliant
SELECT * FROM ansi_compliant_db:accounts;
-- -570: ansi_compliant_db is ANSI-compliant
Checking ANSI-compliance modes first
SELECT name, is_ansi FROM sysmaster:sysdatabases
WHERE name IN ('ordinary_db', 'ansi_compliant_db');
Diagnostic Checks
- Query
sysmaster:sysdatabasesfor theis_ansistatus of both the current and the referenced external database, to confirm the mismatch before deciding how to resolve it.
Related Errors / Related Topics
- -568 — "Cannot reference an external database without logging." The same family of cross-database mode consistency restrictions, for logging rather than ANSI compliance.
- -569 — "Cannot reference an external database with logging." Same family, the mirror-image logging restriction.
Same underlying pattern as -568/-569, for ANSI compliance instead of logging — check
sysmaster:sysdatabases.is_ansi for both sides before writing cross-database SQL.