If you need to use a synonym in a query against an Oracle linked server, you will have to use openquery. This isn't pretty for more complex queries/loads. The syntax for using openquery for this is
- select * from openquery(LinkedServerName, 'select object from synonym.object')
It is also possible (but bad behavior) to look directly at the Synonym and find the referenced object (easiest in a product like toad, but if you use sqlplus the command is DESC synonymname). Again, the developer who created the synonym probably created it because he wants you to use it, so unless you are the developer for the target server, you should really check this is okay.
No comments:
Post a Comment