Oninit Logo
The Down System Specialists
+1-913-674-0360
+44-2081-337529
Partnerships Contact
Finderr

-557 Cannot locate table that is external to the current database

after levels of synonym mapping.

One of the tables named in this query was in fact a synonym, and it pointed outside the current database. It named another synonym that pointed outside its database, and so on for synonyms with no real table being found. The database server has given up on the query in case an endless chain of synonyms exists.

To review the synonyms in the current database that refer to external databases, query systables and syssyntable as follows:

SELECT T.tabname synonym, servername, dbname, user, S.tabname FROM systables T, syssyntable S WHERE T.tabtype = 'S' AND T.tabid = S.tabid AND S.btabid IS NULL

To follow a chain of synonyms through external databases, use a similar query in the external database and substitute for servername, dbname, and tabname the values that the preceding query returns each time.

SELECT T.tabname synonym, servername, dbname, user, S.tabname FROM dbname@servername:systables T, dbname@servername:syssyntable S WHERE T.tabtype = 'S' AND T.tabname = 'tabname' AND T.tabid = S.tabid

When this query returns no row, the requested tabname is not defined as a synonym in that database (it is a table, a view, or not defined).