123
Views
5
Comments
Solved
Change in runtime the external database connection
Question

I'm trying to connect to two different databases with the same structure using the DatabaseConnection_SetConnectionStringForSession function

after using this action, we were unable to connect to the other database, it is still fetching data from the default database.

Note:

   - In the Studio Integration the entities changed [db1]. [Dbo]. [Table], for [table].

   - ConnectionName: <DB2 Connection Name>

   - ConnectionString: "Server = SERVER; Database = DB2; User Id = sa; Password = P;"

Rank: #361
Solution

Can you show how you defined the entity/table mapping in integration studio? It might be that you defined the database and schema hardcoded. 


Rank: #259

Hi,

I guess it is possible to create an extension and do it inside your extension by passing the details of the server and the data to be updated in run time.

Its just my suggestion..

Rank: #361

you can only change the connection in a session when, for that session, you haven't used the existing database connection.

KR Hans

I tried to do it that way, but it didn't bring me the result of the second database, am I doing something wrong?


Rank: #361
Solution

Can you show how you defined the entity/table mapping in integration studio? It might be that you defined the database and schema hardcoded.