Name: country Table or View Name: `country` (remove the name of the database that is before the table name!) Logical Database: platform
Name: country
Table or View Name: `country` (remove the name of the database that is before the table name!)
Logical Database: platform
connectionName: "PlatformModel" (the connection name of the database where the table is initially) connectionString: "Uid=<username>; Pwd=<password>; Server=<server>; Database=<database name>;" (NOTE: the connection string information is about the database to where to want to switch) database identifier:
Hi Rosado,
I am trying to switch between the oracle database, can you please share the screen shot for DatabaseConnection_SetConnectionStringForSession configuration, the format of the connectionstring. I am not getting error and it is not working I used this format for connectionstring property
connectionString: "Uid=<username>; Pwd=<password>; Server=<server>; Database=<database name>;"
ThanksRavikumar S
Hi,
If something is wrong the error should appear on the next query you use after setting the connection.
Ensure that you also use the correct name of the DB Connection in the call. You can try an invalid connection string to try forcing an error.Also note that as said in the action comment, the action has no effect for queries on the same request if that database was already accessed by any during the current request.
Regards,João Rosado
Thanks for the quick reply Rosado,
I have used the same database connection name which I have configured in the service center,
below are the screenshots of the connection string used and error I am getting, I tried with logical database name in the integration studio, I was getting always data from one databse, then I removed the logical database name, then I am getting "error executing query" I have copied the error stack,
please let me know what mistake I am doing,
RegardsRavikumar S
The suggestion I made on the other post was to make a invalid connection string, just to see if it has any effect on the query call. Ex: a host that does not exist to see if a connection error happens instead of the table not found.
I can also see from the screenshots that you are not passing anything on the database identifier. That means it only works if the user in the connection string is the schema owner of the table. If your connection string uses a runtime user with lower permissions (that is not the schema owner) then you also need to pass the schema name on the database identifier parameter for it to look for the table in the correct place.
Please also ensure that the user that you are using has permissions to select the table.
Hi João,
As you suggested, I tried with wrong password to connect, I got exception, on the front end saying “connection timed out”. exception logged
After passing the correct info, and setting the database identifier always getting the data from the same database location Dubai
On change of other location getting error. Is this something related to oracle database permission issue.
Here is the connection string passed to the DatabaseConnection_SetConnectionStringForSession action. Let me know is this excepted format of the connection string for oracle. "Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=1.1.1.1)(PORT=1521)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=ORAZURE)));User Id=userid;Password=pwd;" I connected directly to OracleSQL and able to select the data from both database with same user name and password.
Regards
Ravikumar S
,
That test proves that the action is behaving as expected, and the connection string used for the query is being changed by the call correctly. The format you said also looks fine.
As for the last error screenshot, searching on google, ORA-01435 means that what you passing on the database identifier (to be used as schema) does not exist. Make sure it is correct and with the right capitalization.
Hi João ,
I passed database identifier has input parameter, and passing different identifier based on the location selection, now I am not getting any error but always getting the records from same database.
in integration studio I have removed the database name as suggested in the forum.
Please suggest..
Don't see anything wrong from what you explained.
As long as you are calling the SetConnectionStringForSession once per request and before any query it should give you results for the tables that you are pointing to. Forcing the errors before proves that it's taking effect as expect.
I would suggest to check in the database side the queries that are reaching there to understand what is happening behind the scenes.