|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
dumping data from one table to another table
HI,
I am using oracle as my database. Here i need to dump data from one user table to another user table. ie.., 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. Karthee |
|
#2
|
|||
|
|||
|
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 MINUS SELECT * FROM Table1) / To access the objects of remote database you need DATABASE LINK. Message: Make your life easy, Make others life easier. Regards |
|
#3
|
|||
|
|||
|
Thanx Group,
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... |
|
#4
|
|||
|
|||
|
Yes, it is.
|
|
#5
|
|||
|
|||
|
Thanx... may i know one thing what is the difference between NOT IN and MINUS...though we can use both..
|
![]() |
| Viewing: Dev Shed Forums > Databases > Oracle Development > dumping data from one table to another table |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|