SQL statement joining Oracle and MS SQL Server

随声附和 提交于 2019-11-30 03:18:56

问题


I never seen this, but is it possible to have one SQL call join data from Oracle and SQl Server?


回答1:


Yes- both Oracle and SQL Server support the linked server concept. That allows you to reference the other server using a 4 part name. For example:

select  *
from    LocalDb.Schema.Table
cross join
        OracleLinkedServer.RemoteDb.RemoteSchema.RemoteTable



回答2:


Yes, Oracle and SQL Server both have functionality that allows to connect to other databases, including different vendors. In Oracle terminology, it's a database link instance while on SQL Server it's called a Linked Server instance.

The syntax to reference the instance is different between Oracle and SQL Server though. IE:

Oracle:

SELECT t.*
  FROM table_name@database_link_instance t

SQL Server:

SELECT t.*
  FROM linked_server_instance_name.database_name.schema_name.table_name t

does MySQL support the linked server concept?

No, the closest MySQL has is the FEDERATED engine, which is only for connecting to remote MySQL instances.

PostgreSQL?

PostgreSQL has dblink. Last time I looked at dblink (pre-v9 release), it only could connect to other PostgreSQL instances.



来源:https://stackoverflow.com/questions/3992573/sql-statement-joining-oracle-and-ms-sql-server

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!