db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chris Wilson <ch...@aptivate.org>
Subject Re: Transfer data between tables that are located in different databases
Date Mon, 26 Apr 2010 07:06:46 GMT
Hi Dinesh,

On Sun, 25 Apr 2010, Dinesh Bajaj wrote:

> I haven't written any code yet to implement this functionality, as I 
> couldn't thought of a decent way to do this. I was mainly looking for a 
> feature to initialize the target ResultSet from the source ResultSet and 
> then updating the target one to save the data in one go. I wanted to 
> avoid the mundane task of reading row-by-row from a source Resultset and 
> then putting in the target ResultSet.
> As it is a lot of data that needs to be transferred between tables, the 
> idea of using the system procedures to export the data from the source 
> table, and then importing it in the target table appears to be good one. 
> I will definitely give it a try, and will post the code here if I 
> encounter any error.

How about in SQL:

INSERT INTO target SELECT * FROM source;

Without any resultsets.

Cheers, Chris.
Aptivate | http://www.aptivate.org | Phone: +44 1223 760887
The Humanitarian Centre, Fenner's, Gresham Road, Cambridge CB1 2ES

Aptivate is a not-for-profit company registered in England and Wales
with company number 04980791.

View raw message