When building and testing a QV application, you will typically use a production database (or live EDW) or a test database. It’s helpful to have a variable switch in the script to allow you to easily switch back and forth between the test and prod server. QQQ blog has a great explanation of how to use this variable switch.
It’s relatively easy to create a simple switch with which you can switch between development and production connections. Let’s show an example:
SET vProduction= 0;
IF vProduction = 1 THEN
···ODBC CONNECT TO MyOracleDBProd (XUserID is *****, Xpassword is ****)
SET vDBName = ‘MyOracleDBProd‘;
···ODBC CONNECT TO MyOracleDBDev (XUserID is *****, Xpassword is ****)
SET vDBName = ‘MyOracleDBDev‘;
So that’s the switch, now in your load statements use the variable we just created like below:
SQL SELECT *
It’s good practice to include this switch if you are in a multi-db environment. Setup is quick and usage is even quicker. Update: Qlik Share has posted a great video on using an external script for a dynamic connection string.