File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JDBC and the fly likes Which SQL Statement should use for that?? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Which SQL Statement should use for that??" Watch "Which SQL Statement should use for that??" New topic
Author

Which SQL Statement should use for that??

Ahamed Sharif
Ranch Hand

Joined: Aug 24, 2003
Posts: 47
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

Joined: Feb 27, 2002
Posts: 8904

In Oracle you can use
insert into table1 select * from table2;
Try this! May it will work! :roll:


Groovy
Ahamed Sharif
Ranch Hand

Joined: Aug 24, 2003
Posts: 47
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.
 
wood burning stoves
 
subject: Which SQL Statement should use for that??
 
Similar Threads
SQL and table
SQL statement question
Please help me in creation of tables
Need a Help!!
Copying data from one DB to another