DatabaseConnection_SetConnectionStringForSession Connection string error

Hi all,

I'm trying to use the DatabaseConnection_SetConnectionStringForSession action from the PlatformRuntime_API to switch from one external database to another. 

Both databases have the same tables and attributes.

The action asks for both the connection name and connectionstring which is hardcoded at this point.

However when I try to retrieve data from the selected database after the action it throws any sorts of error saying the connectionstring is incorrect no matter in which form I pass the connectionstring.

Now I have 2 questions:

1. Is it possible to retrieve the connectionstring defined in servicecenter to be used here?

2. What would be the specific format of the connection string needed to pass to this action to work?

Our connection uses the following attributes and is an oracle connection:

Hi,

I do not think we can get the connection string configured in the outsystems service center. Quick search on the google got me below format from https://www.connectionstrings.com/oracle/

Data Source=myOracleDB;User Id=myUsername;Password=myPassword;

or 

Data Source=(DESCRIPTION =(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST = 000.00.0.00)(PORT = 0000)))(CONNECT_DATA =(SERVICE_NAME = database)));User ID=User/Schema;Password=password;

Thanks.

Prasad Rao wrote:

Hi,

I do not think we can get the connection string configured in the outsystems service center. Quick search on the google got me below format from https://www.connectionstrings.com/oracle/

Data Source=myOracleDB;User Id=myUsername;Password=myPassword;

or 

Data Source=(DESCRIPTION =(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST = 000.00.0.00)(PORT = 0000)))(CONNECT_DATA =(SERVICE_NAME = database)));User ID=User/Schema;Password=password;

Thanks.

Hi Prasad,

I found that site as well using google and tried both formats which resulted in 2 different errors:

1. ORA-12154: TNS:could not resolve the connect identifier specified

2. user id' is an invalid connection string attribute

Perhaps you can tell me what is wrong with the following connectionstring?

Data Source=(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=s51uk52.cmcdev.be)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=iso_refac_dt1.cmcdev.be)));User Id=User;Password=Pass;


Glenn


Hi Glenn,

https://www.c-sharpcorner.com/UploadFile/nipuntomar/connection-strings-for-oracle/ has various format depending on the use case

Did you check this form post. you can use the connection string mentioned in the post, I am not sure of the additional parameter "Integrated Security" helps in your case (Specifying username and password from the link above)

Data Source=MyOracleDB;User Id=Username;Password=myPassword;
Integrated Security=no;

Try below if you SID is iso_refac_dt1.cmcdev.be (Its usually the same as service name but for advance configuration it can be different)

DATA SOURCE=s51uk52.cmcdev.be:1521/iso_refac_dt1.cmcdev.be;User Id=User;Password=Pass;

or

Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=s51uk52.cmcdev.be)(PORT=1521)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=iso_refac_dt1.cmcdev.be)));User Id=User;Password=Pass;

I do not have access to one instance with Oracle DB, so hope this helps.

Thanks.