Autocomplete not working for tables in database under a synonym

Hi there,

I'm looking to get autocomplete working for tables that are in a database as a synonym. Autocomplete is working correctly for tables that are in a database. This was also a problem for me when using 0xDBE.

In the Schemas tabs for a Project Data Source, I have checked everything for a particular database where a synonym has been created, and also for the database with the original table. Screenshot to show example of my settings below.

Perhaps I'm doing something wrong - any help would be greatly appreciated!

Screen Shot 2016-01-12 at 16.46.04.png

Thanks,
Graham

0
10 comments

Hello Graham,
Can you query the data using synonyms? Does the completion work if you prefix synonym with the schema/database name? Check if it helps enabling Resolve unqualified references for the schemas/databases which has synonym and re-run Synchronization for this Data Source.

If problem remains, can you please attach output of Test Connection button and ddl of the synonym? Thanks.

0
Avatar
Permanently deleted user

I ran into this issue today. I was able to get code completion for Synonyms (in Oracle) after doing what you suggested -

"enabling Resolve unqualified references for the schemas/databases which has synonym and re-runSynchronization for this Data Source".

Just FYI - Thank you for the solution.

Bobby

0
Avatar
Permanently deleted user

This option seems missing in 2017.1... how can I resolve this problem then?

EDIT: Geez... you just have to set the current schema correctly (upper right in the console) in order to reference the correct database objects. Thanks for making me feel stupid... again... ;-)

0

Same problem here - no auto completion of synonyms and synonyms are not recognized ("unable to resolve table")

In 2017.2, "resolve unqualified references" option isn't available.  I can query the table using the synonym.  It doesn't help to qualify with the schema first. 

I tried Preferences/Database/SQL Resolution Scopes - added my sql file and chose the schema from the drop down.  Nothing seemed to happen.  When I came back to this screen, the mapping had disappeared.

When I try to generate DDL of the synonym to the console, I get nothing.

Database is DB2.

1

having the same issue with version 2021.1.3. The 'resolve unqualified references' option is not available in this version either.  Database is db2 using the z/os driver.  MsSql and postgres work fine.  Only db2 is not resolving. 
Viewing The same database in dBeaver works fine as well.  dBeaver doesn't distinguish synonyms.  They all appear as tables. 

0

Jim Orten. Thank you. you are the life saver! I have been searching for a month to solve this. finally solved it. Thank you.. 

0

Hi Arammarm. Looks like you solved the problem. I looked up Jim Orten comment but didn't find a resolution there. Could you please let me know how did you solve it. I am using 2021.* version.

0

Replying here to my own question, hoping it helps someone. In 2021.* versions you should be able to find the option of 'Force Refresh' in the 'Database Tools' option which you get when you right click the data source. 'Force Refresh' helped resolve the problem for me.

0

srikanth,

Could you describe in details your issue?

Since refresh just removes all schema metadata and loads them again.

0
Avatar
Permanently deleted user

Ran into this issue as well, with Oracle. In the end I found I had to have the PUBLIC schema introspected in order for the public synonyms to be recognized. This is of course, pretty obvious, once you know it, but in the off chance anyone else has the same oversight as me I thought I'd post it here anyway.

2

Please sign in to leave a comment.