Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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!
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;
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;
Thanks a lot Massimo !! the Fix work