Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
tabletuner
Creator III
Creator III

Read all database tables automatically in qlikview

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

2 Replies
flipside
Partner - Specialist II
Partner - Specialist II

Have a look at the help menu for SQLCOLUMNS, SQLTABLES & SQLTYPES. This will be what you are looking for.

flipside

tabletuner
Creator III
Creator III
Author

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