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
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.