-
Expert Member
Copy Table
Employeedetails in user1,employeedetails in user2 both having same structure i want to replace content of user1.employeedetails with user2.emplooyeedetails how it is possible. Is there any copy command in oracle.
if it is there, how it is used ??.....
-
Re: Copy Table
1. truncate the user1 table.
2. insert into user1 select * from user2;
-
Junior Member
Re: Copy Table
first the insert query should be used then the truncate one,,, otherwise table data will not get copied
-
Junior Member
Re: Copy Table
drop table in user2
then use
create table user2.employeedetails as select * from user1.employeedetails where 1=1
-
Junior Member
Re: Copy Table
No it wont work cause 2 different users even if same database, it wont work.
For this user2 should give select privilege to user1 on this table.
So above suggesion may work plaese try out this 
-
Contributing Member
Re: Copy Table
do u mean somthing like --
copy from user1@database1 to user2@database2 insert tab2 using select * from tab1
?
-
Junior Member
Re: Copy Table
NO same database with different user.
i.e
copy from user1@database1 to user2@database1
n if table name is tab1 in user1@database1 user/schema then queries will
grant select on tab1 to user2@database1 ;--in user1@database1 schema
insert into tab1 select * from user1.tab1; -- in user2@database1 schema
or
create table tab1 as select * from user1.tab1 ; -- in user2@database1 schema
hope u got !
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules