I have two different schemas. Each schema contains different tables. For example a is a table in schema1 and b is table in schema2. Now i want to insert table a data into table b(schema2).
Login to the user which have access to both the schema and run insert command like,
INSERT INTO schema1.table_name
SELECT * FROM schema2.table_name;
Assuming that the tables are identical in both the schema.
schema1 needs privileges on table in schema2
connect schema2
grant select , insert on b to schema1;
Then
connect schema1
insert into schema2.b select * from a;
Or create a synonym
create synonym b for schema2.b;
insert into b select * from a;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With