Jump to content
Registration disabled at the moment Read more... ×
Sign in to follow this  
dormky

MyDAC copy to another DB

Recommended Posts

So I need to copy the contents of one table to another database. But it seems changing the Connection on a TMyQuery erases the data stored in it. Any alternatives that do not require creating a TMyTable ?

Share this post


Link to post

Do you need a universal aproach or on a specific setup? If you need for a specific case you should check out how your server implements insert into select between two databases.

Share this post


Link to post
49 minutes ago, Lajos Juhász said:

Do you need a universal aproach or on a specific setup? If you need for a specific case you should check out how your server implements insert into select between two databases.

The databases aren't on the same server. Obviously if that was the case this would be trivial

Share this post


Link to post
46 minutes ago, Lajos Juhász said:

Depending the servers you are using to could be still possible. 

You mean that MySQL can transfer data directly from one server to the other ? I'm not talking about doing replication, this is for select rows

Share this post


Link to post

If you open TMyQuery when connected to a database and then close and change the connection, all data in TMyQuery will be lost.

 

You need a Connection and Query component to database A (MySQL for example), and you need a Connection and Query component to database B (PostgreSQL for example).

Then you have to iterate the records in the table of database A and insert them in database B with 'INSERT INTO' statements.

 

Share this post


Link to post

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×