October 21st, 2003, 01:58 AM
dumping data from one table to another table
I am using oracle as my database. Here i need to dump data from one user table to another user table.
User : User1
Table name : table1
I need to dump the contents of table1 of user1 to table1 of User2.
Here one thing is i need to insert only those rows which are not present in table1 of user2 but present in table1 of user1.
I think this not dumping..but inserting only selected rows..
Is there any way to do this. if so please suggest me solution.
October 21st, 2003, 10:02 AM
I assume that:
(1) Both users 'User1' and 'User2' are in the same databse.
(2) You are connected to 'User1' and try to insert all rows from Table1 of 'User2' those are not in Table1 of 'User1'.
(3) 'User1' has appropriate privileges to access Table1 in 'User2'
(4) Structure of Table1 is identical in both users.
Write the following query (it is an example only):
INSERT into Table1
(SELECT * FROM User2.Table1
SELECT * FROM Table1)
To access the objects of remote database you need DATABASE LINK.
Message: Make your life easy, Make others life easier.
Comments on this post
October 21st, 2003, 10:17 AM
I have another question on this...
I have a join table AB of 2 different tables Table A and Table B I have to dump this table AB from another user Table AB. Here also only those values i have to dump which is not present in the previous table. Does the above query sufficient to this ?
Please help me out...
October 21st, 2003, 10:32 AM
October 21st, 2003, 10:50 AM
Thanx... may i know one thing what is the difference between NOT IN and MINUS...though we can use both..