7 Replies Latest reply: Nov 12, 2013 4:48 AM by Kalyana Sundaram RSS

    Expedite: More Databases More Tables

    Kalyana Sundaram

      Hi Everyone,

       

      I have a scenario, extracting data from 80 databases(postgres sql).

      So I need an idea of doing this very easily, it means i have created 80 ODBC's, usually we connect to db in Qlikview script and extract the data. But now am not going to do as usual. Because it may consists too many tabs in script or we can split qvw.

      So I got an idea of using some script for extracting the tables in a db, but i need to extract the tables from all the db.

       

      Script for extracting the tables:

      set db='"sample".public';
      TableList:
      SQL SELECT "TABLE_NAME"
      FROM INFORMATION_SCHEMA.TABLES

      where TABLE_SCHEMA='PUBLIC' AND TABLE_TYPE='BASE TABLE';
      let rowCnt=NoOfRows('TableList');
      FOR

      I= 1 to $(rowCnt)

      LET TblName = FieldValue('TABLE_NAME',$(I));

      [$(TblName)]:
      SQL SELECT * FROM $(DB)"$(TblName)";
      if(NoOfRows('$(TblName)')>1) then
      STORE [$(TblName)] into $(path)[$(TblName)].qvd;
      ENDIF

      DROP Table [$(TblName)];
      NEXT

      I;

      But we face one error here, "TABLE_NAME" does not exist here.


      The above script is for extracting the tables from a single db,

      i need to include another scripting here for extracting tables from 80 db's.

      Is it possible to do in Qlikview?


      If yes, please reply me asap to fix the scenario.


      Thanks and Regards,

      Kalyan