CharlieSW10
Programmer
I am a newcomer to MySQL and am trying to work out how I can automate moving data from a table within one MySQL database to a table in another.
I want to ensure that changes made to a table in Database A are reflected in Database B. I assume that the best way to do this would be to use the views and triggers in MySQL 5. Unfortunately both databases are part of packages that use MySQL Server 4.1 and I cannot upgrade at the moment so this option is not open to me.
The update will only ever be in one direction so I think the best solution may be to define a SQL statement that selects all records in one TableX/DatabaseA that have been recently changed and writes the amended records to TableZ/databaseB.
I think this will require an INSERT statement but cannot find a syntax that allows me to enquire on a table in Database A and insert the results into Database B.
Could anyone please help with the syntax I need or perhaps suggest a better approach.
Thank you for your help.
Charlie
I want to ensure that changes made to a table in Database A are reflected in Database B. I assume that the best way to do this would be to use the views and triggers in MySQL 5. Unfortunately both databases are part of packages that use MySQL Server 4.1 and I cannot upgrade at the moment so this option is not open to me.
The update will only ever be in one direction so I think the best solution may be to define a SQL statement that selects all records in one TableX/DatabaseA that have been recently changed and writes the amended records to TableZ/databaseB.
I think this will require an INSERT statement but cannot find a syntax that allows me to enquire on a table in Database A and insert the results into Database B.
Could anyone please help with the syntax I need or perhaps suggest a better approach.
Thank you for your help.
Charlie