Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi Guys,
I have a QVW application that generates QVD files from primary SQL database.
I also have a mirror database copy of that primary server.
What function should I use or what statement to use in the connection string so in case of primary server is down then it will automatically connect to the mirror database?
Hi Lokesh, I didn't tried but maybe using the script error variables, ie:
SET ErrorMode = 0; //If any error is found, continue execution
CONNECT To MainConnection;
IF ScriptError >0 then //If there was an error connecting try this
SET ErrorMode = 1; // If this one fails an error must be thrown
CONNECT TO FailoverConnection;
ENDIF
SET ErrorMode = 1; // In case there was no error, set ErrorMode to 1 for the rest of the script.
Something similar discussed over here by pcammaert
Failover Partner issue or other kind of error? | Qlik Community
try something like this...
DB Connection1; //Primary Database connection
IF ScriptError=3 or ScriptError=4 then
DB Connection 2; // mirror database connection
END IF
Load Stmt1;
Load Stmt2;
Hi Lokesh, I didn't tried but maybe using the script error variables, ie:
SET ErrorMode = 0; //If any error is found, continue execution
CONNECT To MainConnection;
IF ScriptError >0 then //If there was an error connecting try this
SET ErrorMode = 1; // If this one fails an error must be thrown
CONNECT TO FailoverConnection;
ENDIF
SET ErrorMode = 1; // In case there was no error, set ErrorMode to 1 for the rest of the script.