Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi all,
My source is SQL server and database have different password for different environment.
I am trying to handle the ODBC connection dynamically.
I am using below script:
if (wildmatch (v_compName,'100-BIQVW-D*') then
ODBC CONNECT TO $(vODBC) (XUserId is NYOOWIRNJbaCEEBKNKYEHaVV, XPassword is TOSJTQBNQLbCGZROdF)
else if (wildmatch (v_compName,'100-BIQVW-T*') then
ODBC CONNECT TO $(vODBC) (XUserId is VPXPcIRNJbaCEEBKNKYEHadS, XPassword is BXVQJJVMNbbMXSVJFbbB)
else if (wildmatch (v_compName,'100-BIQVW-P*') then
ODBC CONNECT TO AHP_PRD (XUserId is VbcAQIRNJbaCEEBKNKYEHaZc, XPassword is BTCDcQBNQLbCGZROZE)
else if (wildmatch (v_compName,'SBYCSQLSCLNT01*') then
ODBC CONNECT TO $(vODBC) (XUserId is NYOOWIRNJbaCEEBKNKYEHaVV, XPassword is TOSJTQBNQLbCGZROdF
end if
end if
end if
end if
But this is not working.
Can anyone please help me.
Thanks,
Sarif
Try this (at least I don't see error with it now).
if wildmatch (v_compName,'100-BIQVW-D*') then
ODBC CONNECT TO $(vODBC) (XUserId is NYOOWIRNJbaCEEBKNKYEHaVV, XPassword is TOSJTQBNQLbCGZROdF);
elseif wildmatch (v_compName,'100-BIQVW-T*') then
ODBC CONNECT TO $(vODBC) (XUserId is VPXPcIRNJbaCEEBKNKYEHadS, XPassword is BXVQJJVMNbbMXSVJFbbB);
elseif wildmatch (v_compName,'100-BIQVW-P*') then
ODBC CONNECT TO AHP_PRD (XUserId is VbcAQIRNJbaCEEBKNKYEHaZc, XPassword is BTCDcQBNQLbCGZROZE);
elseif wildmatch (v_compName,'SBYCSQLSCLNT01*') then
ODBC CONNECT TO $(vODBC) (XUserId is NYOOWIRNJbaCEEBKNKYEHaVV, XPassword is TOSJTQBNQLbCGZROdF);
end if
end if
end if
end if
;
Hi Mohammad:
You can use a configuration file to import the odbc connection from each enviroment
Best Regards,
Juan P. Barroso
Do you get any messages from QlikView? The ODBC driver? The DBMS? None at all?
it is showing syntax error..I did not executed yet..
for that we need to maintain different config file in diff environment. But we do not want that.
We want single config file across the landscape.
I guess, it's parenthesis issue. Try removing unnecessary '(' after all If (s), like:
if (wildmatch (v_compName,'100-BIQVW-D*') then
Tanks TB for your reply...I did that...still not working.
Attaching file. Could you please check once.
Try this (at least I don't see error with it now).
if wildmatch (v_compName,'100-BIQVW-D*') then
ODBC CONNECT TO $(vODBC) (XUserId is NYOOWIRNJbaCEEBKNKYEHaVV, XPassword is TOSJTQBNQLbCGZROdF);
elseif wildmatch (v_compName,'100-BIQVW-T*') then
ODBC CONNECT TO $(vODBC) (XUserId is VPXPcIRNJbaCEEBKNKYEHadS, XPassword is BXVQJJVMNbbMXSVJFbbB);
elseif wildmatch (v_compName,'100-BIQVW-P*') then
ODBC CONNECT TO AHP_PRD (XUserId is VbcAQIRNJbaCEEBKNKYEHaZc, XPassword is BTCDcQBNQLbCGZROZE);
elseif wildmatch (v_compName,'SBYCSQLSCLNT01*') then
ODBC CONNECT TO $(vODBC) (XUserId is NYOOWIRNJbaCEEBKNKYEHaVV, XPassword is TOSJTQBNQLbCGZROdF);
end if
end if
end if
end if
;
oopss..it was semicolon issue..
And also, Elseif, not else if