Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi Folks,
I have 2 odbc connections one for production, Development.
The entire script remains same only i need to change the odbc connection depending on the computername or servername
so i did like this but its not allowing me to do in the script and throwing an error.
if i want to use the if condition in the script how to add??
IF(ComputerName()='ABC','ODBC CONNECT TO [xysbef;DBQ=xysbef] (XUserId is bJKfcYZODbXKXZVMSbXEXSFMETFA, XPassword is AJWSQYZODDZCGaFMRJIQL)',
if(computername()='DEF','ODBC CONNECT TO [yeyeye;DBQ=yeyeye ] (XUserId is KTDBaYZODbXKXZVMSbXEXSFMEbeB, XPassword is eNUWRYZODDZCGaFMRJIAG)'));
so when the computername is identified it should connect to that server odbc connection.
Thanks
Hi Shree,
just use the IF statement, not function:
IF ComputerName()='ABC' THEN
ODBC CONNECT TO [xysbef;DBQ=xysbef] (XUserId is bJKfcYZODbXKXZVMSbXEXSFMETFA, XPassword is AJWSQYZODDZCGaFMRJIQL);
ELSEIF ComputerName()='DEF' THEN
ODBC CONNECT TO [yeyeye;DBQ=yeyeye ] (XUserId is KTDBaYZODbXKXZVMSbXEXSFMEbeB, XPassword is eNUWRYZODDZCGaFMRJIAG)';
ELSE
// error action
END IF
- Ralf
Hi Shree,
just use the IF statement, not function:
IF ComputerName()='ABC' THEN
ODBC CONNECT TO [xysbef;DBQ=xysbef] (XUserId is bJKfcYZODbXKXZVMSbXEXSFMETFA, XPassword is AJWSQYZODDZCGaFMRJIQL);
ELSEIF ComputerName()='DEF' THEN
ODBC CONNECT TO [yeyeye;DBQ=yeyeye ] (XUserId is KTDBaYZODbXKXZVMSbXEXSFMEbeB, XPassword is eNUWRYZODDZCGaFMRJIAG)';
ELSE
// error action
END IF
- Ralf