This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Which SQL Statement should use for that??

 
Ahamed Sharif
Ranch Hand
Posts: 47
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
How can I Insert a value in one database table to another database table
using JDBC. Please any one have the SQL query like that, and how can I
write that program in Java.
I am using MSAccess 2000.
Thanks,
Fyrose.
 
Pradeep bhatt
Ranch Hand
Posts: 8927
Firefox Browser Java Spring
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In Oracle you can use
insert into table1 select * from table2;
Try this! May it will work! :roll:
 
Ahamed Sharif
Ranch Hand
Posts: 47
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
But I used this query like
String query = " insert into UserInfo (UserName) in 'C:\\User.mdb' select UserInfo from RateInfo";
stmt.executeUpdate(query);
Its inserting the UserName value of the UserInfo table into RateInfo table
the value of UserInfo. But the problem is its inserting the next row.
So the first row will be blank so how can I inser that in a first line.
Could you solve this problem.
Thanks,
Sharief.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic