This week's book giveaway is in the Design forum.
We're giving away four copies of Building Microservices and have Sam Newman on-line!
See this thread for details.
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

Win a copy of Building Microservices this week in the Design forum!
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’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link:
subject: select/insert
It's not a secret anymore!