Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi Forum,
I wonder whether it is possible to read all tables from a database (for example SQL or access) into qlikview automatically.
So im looking for some kind of a looping statement that determines the amount of tables and then reads all the tables into the qlikview cloud. Of course the tables have to be qualified to avoid key conflicts.
I think this solution would provide me good search opportunities with the search object.
Regards,
Tjeerd Wieberdink
Have a look at the help menu for SQLCOLUMNS, SQLTABLES & SQLTYPES. This will be what you are looking for.
flipside
Hi Flipside, thank you very much for the great advice!
Here is the code that worked for me:
tables_t01:
sqltables;
tables:
NoConcatenate LOAD
*
RESIDENT tables_t01
WHERE
TABLE_TYPE='TABLE';
DROP Table tables_t01;
LET vNoOfTable = fieldvaluecount('TABLE_NAME');
qualify *;
for a=1 to $(vNoOfTable)
LET vTableName = fieldvalue('TABLE_NAME',$(a));
LET vTableType = fieldvalue('TABLE_TYPE',$(a));
$(vTableName):
SQL SELECT *
FROM $(vTableName)
;
next