• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

select/insert

 
Peter Straw
Ranch Hand
Posts: 79
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 79
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks - using a runtime exec command?
 
Dana Hanna
Ranch Hand
Posts: 227
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you need to do it in the app, you'd be better off using JDBC, and the execute() method of Statement.
 
Don't get me started about those stupid light bulbs.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic