Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
datanibbler
Champion
Champion

Connections to different databases?

Hi,

I now have a rather big app to fetch from the database all the packing_plans which were valid for any given month in the past.

The issue is, we have two different database systems - one for this plant here and one for the other plant. There is an ODBC connection in every one of those apps. So I need three apps: One to get the data from this system, one to get the data from the other system and one to combine the two into one monthly file.

Is there any possibility to do all that in one app? That would be much more practical.

Thanks a lot!

Best regards,

DataNibbler

1 Solution

Accepted Solutions
ahaahaaha
Partner - Master
Partner - Master

Yes exactly. In one application in the script, I generally wrote the first two lines of the connection code to two different databases and then unloaded the necessary data from them in an arbitrary order.

View solution in original post

5 Replies
ahaahaaha
Partner - Master
Partner - Master

Hi,

No problem. In the script, you need to establish a link with each of your databases and load data from them into QlikView, taking into account the correct organization of the data structure and field names.

Regards,

Andrey

datanibbler
Champion
Champion
Author

Hi Andrey,

in every one of the apps I have an ODBC connect_string - so I could just take the first app and copy the connect_string from the second app in on a sheet when all is done for one database and all tables have been stored away and deleted?

That would make the whole thing much more manageable.

I'll try.

ahaahaaha
Partner - Master
Partner - Master

Yes exactly. In one application in the script, I generally wrote the first two lines of the connection code to two different databases and then unloaded the necessary data from them in an arbitrary order.

datanibbler
Champion
Champion
Author

Thanks a lot!

Well, I would probably connect to the second database only after everything on the data from the first one is done to avoid a timeout - the script contains some loops and runs for quite a while ...

Best regards,

DataNibbler

datanibbler
Champion
Champion
Author

Hi,

something seems to not be right - I now have both SQL_SELECTs (from two different databases) on one sheet - but both have the same structure, so the LOAD statement is the same - when I load from the second database, the plant_key is that of the first one, so I'm not sure that works as expected ... when I deactivate the first half of the code and load only the table from the second database, it is correct.

Is there some statement I can use to close the connection after use so there can be no "misunderstanding"?

Thanks a lot!

Best regards,

DataNibbler