Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Posting on Qlik Community is temporarily paused for some users. Thank you for patience and we'll update you soon!
cancel
Showing results for 
Search instead for 
Did you mean: 
Sangeeta
Contributor III
Contributor III

QMC - Multiple hosts in connection string in data connections

Hello,

I have some data connections created using QMC. It is connecting to the active database host. However, I need to switch to another host during the disaster recovery test conducted on the active server. Is it possible to give multiple hostname in the connection string so that I don't have to change the connection string manually to ensure no downtime.

Here is my connection string -

CUSTOM CONNECT TO "provider=QvOdbcConnectorPackage.exe;driver=oracle;ConnectionType=basic;host=<hostname>;port=1521;servicename=<servicename>;USETNS=false;EnableNcharSupport=1;allowNonSelectQueries=false;QueryTimeout=30;useBulkReader=true;maxStringLength=4096;logSQLStatements=false;"

Labels (1)
1 Reply
PREMinQLIK_DBS2
Contributor II
Contributor II







Hi There, 

Try below
create multiple connections for example like below

lets say you created 3 connections with separate hostnames : sample : 
Connecton_DB_1
Connecton_DB_2
Connecton_DB_3


SET ErrorMode=0; //To ignore error message and not prompt user for action
SET vConnectionLoop=1;
LET  vConnectionNo=1;

Do
ODBC CONNECT TO Connecton_DB_$(vConnectionNo);
IF Len(ConnectString())=0 Then
SET vConnectionLoop=1;
LET vConnectionNo = $(vConnectionNo)+ 1;
ELSE
SET vConnectionLoop=2;
ENDIF
LOOP while vConnectionLoop=1;

SET ErrorMode=1;