Informix Error -218
-218 Synonym synonym-name not found.
The synonym is not defined in this database. Check that the name is spelled as you intended. Check that you are using the right database. If so, the synonym was probably dropped. Possibly it was dropped automatically when the table for which it stood was dropped. To display all defined synonyms, query systables as follows:
SELECT tabname FROM systables WHERE tabtype = 's'
Oninit® Troubleshooting Guidance
Reasons / Common Causes
-218 is the synonym-level member of the same "object not found" family as -206 (tables) and -217 (columns) — a synonym referenced in a statement isn't defined in the current database.
- A misspelled synonym name — the straightforward, most common case.
- Connected to the wrong database. The synonym exists, but in a different database than the one the current session is connected to.
- The synonym was dropped deliberately.
- The synonym was dropped automatically when its associated table was removed. This is worth knowing specifically — dropping the underlying table can silently take the synonym with it, which isn't always obvious to someone who only thinks about the synonym as a separate object.
- Environment or migration drift — a synonym defined in one environment not replicated to another.
Solutions / Resolution
- Verify the spelling of the synonym name.
- Confirm you're connected to the correct database.
- Query the catalog to list all defined synonyms and confirm whether the intended one
actually exists:
SELECT tabname FROM systables WHERE tabtype = 's'; - If the synonym was automatically dropped when its underlying table was removed, decide whether recreating the table and/or synonym is needed, or whether references to the synonym should instead be updated to point at wherever the data actually lives now.
- For environment drift, ensure synonym definitions are consistently replicated as part of standard schema/environment parity checks.
Examples
Listing all defined synonyms
SELECT tabname FROM systables WHERE tabtype = 's';
Run this before assuming a specific synonym is missing entirely — it might just be misspelled in the failing statement, or defined under a slightly different name than expected.
A synonym that vanished with its table
CREATE SYNONYM cust FOR customer;
-- Later:
DROP TABLE customer;
-- cust is automatically dropped along with it
SELECT * FROM cust;
-- -218: cust no longer exists, because customer was dropped
The fix depends on intent — recreate customer (and cust along with it, or explicitly), or
update code referencing cust to point at wherever that data now actually lives.
Diagnostic Checks
- Query the catalog for defined synonyms:
SELECT tabname FROM systables WHERE tabtype = 's'; - Confirm the current database connection.
- Check whether the underlying table for the expected synonym still exists, if a recent
DROP TABLEis a plausible explanation.
Related Errors / Related Topics
- -206 — "The specified table
is not in the database." The table-level sibling in this same "object not found" family. - -217 — "Column column-name not found in any table in the query." The column-level sibling in the same family.
Remember that dropping a table can silently drop its synonyms too — check whether that's what happened before assuming the synonym was removed independently.