Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Insert records from one table to another 1

Status
Not open for further replies.

gxydas

Programmer
Joined
Jan 15, 2005
Messages
76
Location
GR
Hi all,

I have two database tables. One in paradox (tb1) and one in mysql (tb2).

I can see the records of each table.

I want to create a query that passes the records from to tb1 to tb2.

How can I do that?

Thanks.
 
You should look at the batch move command

 
Could you be more specific on how to use batch move command?
 
Sorry not command, It is a component, which allows quick copy from one table to another.
Coming to think of it, it might not work with cross database. You should look at it anyway.

Of course you can use use a query, to extract then a loop to insert. Slower but works.

Query1.SQL.ADD('SELECT * from TableA');
query1.open;
while not query1.eof do
begin
SQLStr:='Insert into TableB Values('+Query1.fields[0].asstring.......;
if query2.active then Query2.close;
Query2.sql.clear;
Query2.sql.add(SQLStr);
Query2.execsql;
end

you get the idea.
 
I got the idea.

Thanks schu
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top