Just ran into this as a production problem. We need to pull data from one database table into another table on a completely different database. Two separate databases but this could be from any of the 7 that are operating.
What would be the best way for the client application to pull from one and then push into another? I read somewhere about a multi database login. Is that the course to take? Are there any sample code of this anywhere?
To extend that TDataService SetConnectionName, what would be the proper way to also take that SetConnectionName and then pass and execute the sql query. ( const ConnectionName: ROUTF8String, const SqlQuery: String ) so that we can execute from the client.
I think that would solve our problem. We are going back and forth with the databases when we are trying to pull a work order from one database and then create into another. Very typical master / detail record pull and inserts.
I was working on another completely different case yesterday where we cannot use the above for a similar case. But that one will require two separate logins because they exist on two different servers with two completely different ip addresses. Real life is complicated.
This one involves a catering operation that interacts directly with some of their customers where they are pulling data directly from the customer ( which also are using our system, convenient ). These are not just once in while pulls. They are pulling multiple big events every day.
And we have the same problem with another where they oversee multiple event centers each with their own calendars and event work orders. When we figure these out, I will try to share with everyone our solutions and then maybe those can be used by others and expanded.
You can use 2 connections simultaneously on server-side. this is acceptable but requires manual coding.
also it is possible to combine several tables from different DB servers and use combined result set as one table … check more at Union Tables and Managing Union Tables