Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
shiveshsingh
Master
Master

Connection String

Suppose i have 2 data sources.

In 1 data source, i have 5 tables and in other i have 3 tables.

I wrote 1 connection string and took 3 tables from first source. Then wrote 2nd connection string and took 3 tables.

Now i need remaining 2 tables from first data source.

Do i need to write first connection string again?

11 Replies
Not applicable

Hi Shivesh,

Yes, you'll have to write the 1st connection string again since you have overwritten it with the new one.

alis2063
Creator III
Creator III

once connection is  established ,you can import the table as per our requires.you don't need to make connection again

krishnacbe
Partner - Specialist III
Partner - Specialist III

You can create QVD for each table from particular connection, then create QVDs from second connection.

So that you can join the QVDs as per your requirement

vvira1316
Specialist II
Specialist II

Hi,

You may want to use Disconnect as needed

Invalid object name

Colin-Albert

Hi Ali,

QlikView can only have one connection active at a time.

If you use Connection 1 and load tables using connection 1

Then add connection 2 and load tables using connection 2, you cannot then load tables using connection 1 again without having the connect string for connection 1 a second time in the script.

Load XXX from yyyy.    Will always use the most recent connection string.

shiveshsingh
Master
Master
Author

That means, we have to write connection string again?

Colin-Albert

Yes, you can just copy the connect string line again.

Peter_Cammaert
Partner - Champion III
Partner - Champion III

Or put the actual Connection String in a variable and use it as many times as you want. Like in:

SET vConnectionString1 = Blablabla1;

SET vConnectionString2 = Blablabla2;

OLEDB CONNECT TO '$(vConnectionString1)';

LOAD * FROM Table1;

LOAD * FROM Table2;

LOAD * FROM Table3;

OLEDB CONNECT TO '$(vConnectionString2)';

LOAD * FROM Table6;

LOAD * FROM Table7;

LOAD * FROM Table8;

OLEDB CONNECT TO '$(vConnectionString1)';

LOAD * FROM Table4;

LOAD * FROM Table5;

DISCONNECT;

But I would load all five tables from the first connection and the three remaining ones from the second connection. Saves you one connection.

Chanty4u
MVP
MVP

yes if you have multiple data sources you have to use connection string in each tab/table  then only it will work