7 Replies Latest reply: May 29, 2014 10:16 AM by Chris Williams RSS

    Loading Reult Of SQL query into Variable to be used in connection string

      HI I am trying to use the reult of a query (A database name) into a qlikview varible so that I can then use it to create a connection string to that databse.

       

      Below is an example of what I have been trying. Any ideas how to load the result of a SQL query into a variable

       

       

       

      CONNECT TO [Provider=SQLOLEDB.1;Integrated Security=SSPI;Initial Catalog='Qlikview_MiltipleDBsTest1';Data Source=$(Vdatasource)];

       

       

      DatabaseName: SQL SELECT top 1 DatabaseName  FROM dbo.COnfigurations  ;

       

      LET  VdatabaseName =  [DatabaseName.DatabaseName]  ;

       

      DISCONNECT ;

       

       

      CONNECT TO [Provider=SQLOLEDB.1;Integrated Security=SSPI;Initial Catalog=$(VDatabaseName);Data Source='LGA1']

       

       

       

      Thanks for any help.