wood burning stoves
The moose likes JDBC and Relational Databases and the fly likes select/insert Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "select/insert " Watch "select/insert " New topic


Peter Straw
Ranch Hand

Joined: Jan 08, 2002
Posts: 79
Does anyone know a good way to move data from one table to another please?
The only one I can think of is to do a SELECT statement and then go through the ResultSet and for each result create an INSERT statement. Seems a bit long-winded...
Many thanks
clement valentine

Joined: Apr 04, 2002
Posts: 19
I would do it outside the application (using sql) if there is not much transformation/business rules in moving from one table to another.
eg insert into A select * from B
Peter Straw
Ranch Hand

Joined: Jan 08, 2002
Posts: 79
thanks - using a runtime exec command?
Dana Hanna
Ranch Hand

Joined: Feb 28, 2003
Posts: 227
If you need to do it in the app, you'd be better off using JDBC, and the execute() method of Statement.
I agree. Here's the link: http://aspose.com/file-tools
subject: select/insert
It's not a secret anymore!