Informix Error -568: Cannot reference an external database without logging.
Cause and resolution
Cannot reference an external database without logging.
This statement refers to a database other than the current database. However, the current database uses transaction logging, and the external one does not. This action is not supported; the databases that are used in a single transaction must all use logging or all not use it.
Oninit® Troubleshooting Guidance
Reasons / Common Causes
-568 fires when a statement in the current (logged) database references an external database that doesn't use transaction logging — per the official guidance, all databases participating in a single transaction must either all use logging or all not use it, and this statement tries to mix the two.
- A cross-database reference from a logged database to an unlogged one, per the official guidance — the direct, only cause.
- A staging/ETL database deliberately created without logging (for load performance) being referenced from a logged application database within the same transaction, without accounting for this restriction.
- A database's logging mode changed after cross-database SQL was already written against it, turning previously valid cross-database statements into ones that now violate this rule.
Solutions / Resolution
- Make the databases' logging modes consistent, per the official guidance's underlying requirement — either add logging to the external database, or work with it from an unlogged context instead.
- If the external (unlogged) database's lack of logging is intentional (e.g. for staging/ETL performance), avoid referencing it directly from a logged database's transaction — move data between them via an unload/load step instead of an in-transaction cross-database reference.
- Check a database's logging mode before writing cross-database SQL against it:
SELECT is_logging FROM sysmaster:sysdatabases WHERE name = 'external_db';
Examples
The disallowed cross-database reference
DATABASE logged_app_db; -- uses logging
SELECT * FROM unlogged_staging_db:raw_import;
-- -568: unlogged_staging_db doesn't use logging
Checking logging modes first
SELECT name, is_logging FROM sysmaster:sysdatabases
WHERE name IN ('logged_app_db', 'unlogged_staging_db');
Diagnostic Checks
- Query
sysmaster:sysdatabasesfor theis_loggingstatus of both the current and the referenced external database, to confirm the mismatch before deciding how to resolve it.
Related Errors / Related Topics
- -569 — "Cannot reference an external database with logging." The mirror-image restriction: an unlogged current database referencing a logged external one.
- -570 — "Cannot reference an external ANSI database." The same family of cross-database mode consistency restrictions, for ANSI compliance rather than logging.
All databases in a single transaction must share the same logging mode — check
sysmaster:sysdatabases.is_logging for both sides before writing cross-database SQL.