Skip to main content
Announcements
Global Transformation Awards! Applications are now open. Submit Entry
cancel
Showing results for 
Search instead for 
Did you mean: 
swapnil_kumbhar
Partner - Contributor III
Partner - Contributor III

How to Get Database Name which we have connected to?

Hi,

Is there any function available in Qlikview which gives us currently connected Database name?

Attached herewith screenshot for reference. I want to store these values in Variable.

Regards,

Swapnil

6 Replies
Gysbert_Wassenaar

When a user interacts with a Qlikview document there is no connection with a database. Only when the document is reloading will there be a connection with a database. If you want you can create variables in the script containing the connection information, but you have to set the values yourself. You could then use the variables in the CONNECT statement too. What some developers do is create files for small script snippets for connection statements and use the include or must_include variables to insert these script files in the script.


talk is cheap, supply exceeds demand
Anonymous
Not applicable

Most of my data sources are Oracle databases and I often need to extract the Oracle User Name and include it as a field in the QlikView table.  Which I do using this SQL.

     SELECT user FROM dual ;



swapnil_kumbhar
Partner - Contributor III
Partner - Contributor III
Author

So for that Variable i need to insert connection information manually. I will not get it automatically.

Is it right?

Gysbert_Wassenaar

That's correct.


talk is cheap, supply exceeds demand
Gysbert_Wassenaar

Well, yes, you can get all sorts of metadata from a dbms too. But if you first specify you want to connect to database foo as user bar and you then want this values available as variables as well, why not create them as variables in the first place and then reuse those variables in the connect statement?


talk is cheap, supply exceeds demand
Anonymous
Not applicable

Yup - there is more than one way to skin a cat.