Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: copy certain data from one database to another
On Sat, 22 Feb 2003 21:56:09 +0000, David Nguyen wrote:
> Hi All,
>
> I have another challenge need to ask:
>
> I want to copy (or EXP/IMP) 50 rows of data from one table of 1000
> rows from one database to another DATABASE same table structure but
> already contain data 500 rows.
>
> I don't know if it can be done. If it can what happen if some of the
> rows is duplicates?
>
> Thanks in advance
>
> DAVID
Set up a database link between the two databases, and then use the 'insert
into X select * from Y' syntax to effect the transfer of the rows. The 'Y'
entry will be in the form of table_name_at_database_link, assuming you are
issuing the command whilst connected to the destination database.
What happens if there are duplicates? Depends: is there a primary key on the destination table? If there is, the duplicates will not be permitted. If there isn't, they will be. Disable the primary key if you *want* the duplicates, and cleanse the data by hand before attempting to re-enable the constraint.
Regards
HJR
Received on Sun Feb 23 2003 - 05:21:52 CST