Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我在数据库 A 中有一个表 t1,在另一个数据库 B 中有另一个表 t2。我们如何在不直接使用限定符的情况下从中选择数据......就像 database1.table1.something。
您应该能够使用完全限定名称(例如 SCHEMA.TABLE@DBLINK)对其进行查询。如果您不想在从数据库 A 查询时使用 @DBLINK 表示法,您可以在视图(在数据库 A 中)中屏蔽 @DBLINK 并改为查询该视图。
CREATE OR REPLACE VIEW remote_table [(column_list)] AS select * FROM SCHEMA.TABLE@DBLINK;