Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements
QlikView Fans! We’d love to hear from you.
Share your QlikView feedback with the product team… Click here to participate in our 5-minute survey.
Rules, plus terms and conditions, can be found here.
Not applicable

Two different connection strings

Hi all,

I have to two database connection strings which are from two different oracle database servers but contains same tables and views.

I need to connect to main database server, if connection is successful then i will use this connection string else, I will connect to secondary database server and use secondary connection string to pull the data.

I think script would be like this,

if ConnectionString1='Success' then

ConnectionString1

Else

ConnectionString2

End if

Now how do I check if first/second connection is successful or not in script?

Any help would be great.

Thanks in advance.

Cheers,

Amay.

Tags (1)
1 Solution

Accepted Solutions
MVP
MVP

Re: Two different connection strings

Hi Amay,

you can catch the ScriptError:

set ErrorMode=0;

CONNECT <ConnectionString1>...;

if ScriptError>1 then

     //not connected ConnectionString1...

     CONNECT <ConnectionString2>...;

end if

set ErrorMode=1;

- Ralf

2 Replies
MVP
MVP

Re: Two different connection strings

Hi Amay,

you can catch the ScriptError:

set ErrorMode=0;

CONNECT <ConnectionString1>...;

if ScriptError>1 then

     //not connected ConnectionString1...

     CONNECT <ConnectionString2>...;

end if

set ErrorMode=1;

- Ralf

Not applicable

Re: Two different connection strings

Thanks Ralf

Community Browser