繁体   English   中英

如何以不同的模式将数据(所有 dml 语句)从一个表复制到另一个表 oracle

[英]How replicate data(all dml statement) from one table to another table in different schema oracle

我想将表 A 的数据复制到 B,因为我们在表 B 中有一些不同的列。所以可以复制数据。

模式名称也不同

例子:

表A

(custome_name, customer_desc,create_date,create_user,update_date,update_user)

表 B

(customer_id,custome_name, customer_desc,create_date,create_user,update_date,update_user)

用户B必须向用户A授予权限,以便A可以将数据插入到他们的表中:

grant insert on table_b to a;

然后,用户A将编写一个INSERT语句,指定用户Btable_b中的哪些列将使用table_a中的哪些列值填充

INSERT INTO b.table_b (custome_name,
                       customer_desc,
                       create_date,
                       create_user,
                       update_date,
                       update_user)
   SELECT custome_name,
          customer_desc,
          create_date,
          create_user,
          update_date,
          update_user
     FROM table_a;

而已。


如果用户驻留在不同的数据库中,您将使用数据库链接

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM