使用SQL在Oracle模式之间复制数据 [英] Copying data between Oracle schemas using SQL
本文介绍了使用SQL在Oracle模式之间复制数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在尝试使用INSERT INTO (...)
SQL语句将数据从一个Oracle模式(CORE_DATA
)复制到另一个(MY_DATA
).
I'm trying to copy data from one Oracle schema (CORE_DATA
) into another (MY_DATA
) using an INSERT INTO (...)
SQL statement.
SQL语句是什么样的?
What would the SQL statement look like?
推荐答案
以具有访问权限的用户身份登录时,使用模式名称为表名加上前缀:
Prefix your table names with the schema names when logged in as a user with access to both:
insert into MY_DATA.table_name select * from CORE_DATA.table_name;
假设两个模式中的表定义相同,则上面的代码会将所有记录从CORE_DATA中名为table_name的表复制到MY_DATA中名为table_name的表.
Assuming that the tables are defined identically in both schemas, the above will copy all records from the table named table_name in CORE_DATA to the table named table_name in MY_DATA.
这篇关于使用SQL在Oracle模式之间复制数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文