连接 Oracle 和 MS SQL Server 的 SQL 语句

发布于 2024-09-28 16:34:48 字数 65 浏览 0 评论 0原文

我从来没有见过这一点,但是是否有可能通过一个 SQL 调用连接来自 Oracle 和 SQl Server 的数据?

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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

凉宸 2024-10-05 16:34:48

是的,Oracle 和 SQL Server 都具有允许连接到其他数据库(包括不同供应商)的功能。在 Oracle 术语中,它是一个数据库链接< /a> 实例在 SQL Server 上称为 链接服务器 实例。

不过,Oracle 和 SQL Server 之间引用实例的语法是不同的。 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

MySQL 支持链接服务器概念吗?

不,最接近的 MySQL 是 FEDERATED 引擎,它仅用于连接到远程 MySQL 实例。

PostgreSQL?

PostgreSQL 有 dblink。上次我查看 dblink(v9 之前的版本)时,它只能连接到其他 PostgreSQL 实例。

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.

2024-10-05 16:34:48

是的 - Oracle 和 SQL Server 都支持链接服务器概念。这允许您使用由 4 部分组成的名称来引用其他服务器。例如:

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

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
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文