Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

connection à plusieurs sources de données

Bonjour,

j'aimerais réalisé un script qui permet de choisir la source de données

exple :

switch(choix_menu) {

case 1: ODBC CONNECT TO [Base de données 1];

break;

case 2: ODBC CONNECT TO [Base de données 2];

break;

case 3: ODBC CONNECT TO [Base de données 3];

break;

}


merci d'avance!

1 Solution

Accepted Solutions
maxgro
MVP
MVP

SET vEnvironment= ‘PROD’;

IF vEnvironment = ‘PROD’ THEN

     ODBC CONNECT TO MyOracleDBProd (XUserID is *****, Xpassword is ****)

     SET vDBName = ‘MyOracleDBProd‘;

ELSEIF vEnvironment = ‘TEST’ THEN

     ODBC CONNECT TO MyOracleDBTest (XUserID is *****, Xpassword is ****)

     SET vDBName = ‘MyOracleDBTest‘;

ELSE

     ODBC CONNECT TO MyOracleDBDev (XUserID is *****, Xpassword is ****)

     SET vDBName = ‘MyOracleDBDev‘;

END IF

in load script you can use vDBName in this way

SQL SELECT *

FROM $(vDBName).MySchema.MyTable;

View solution in original post

2 Replies
maxgro
MVP
MVP

SET vEnvironment= ‘PROD’;

IF vEnvironment = ‘PROD’ THEN

     ODBC CONNECT TO MyOracleDBProd (XUserID is *****, Xpassword is ****)

     SET vDBName = ‘MyOracleDBProd‘;

ELSEIF vEnvironment = ‘TEST’ THEN

     ODBC CONNECT TO MyOracleDBTest (XUserID is *****, Xpassword is ****)

     SET vDBName = ‘MyOracleDBTest‘;

ELSE

     ODBC CONNECT TO MyOracleDBDev (XUserID is *****, Xpassword is ****)

     SET vDBName = ‘MyOracleDBDev‘;

END IF

in load script you can use vDBName in this way

SQL SELECT *

FROM $(vDBName).MySchema.MyTable;

Not applicable
Author

Thanks a lot Massimo !! the Fix work