Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Script to get all tables from a single database

Hi,

In my database, there are 90 tables. I need all those tables into my qlikview.

Can anyone tel me how to write script with 'for each' statement ??

Thanks and regads,

Guru

2 Replies
christian77
Partner - Specialist
Partner - Specialist

When you click the Select button, you see a DB dialogbox. Select your tables and click on add.

When you have added all, finish it.

You may want to use the file attached. The autor of the file is not me. I downloaded from this community.

martinpohl
Partner - Master
Partner - Master

Hello Guru,

try this

CONNECT TO your database

T2:
SQLTables; //read database information
T1: load chr(39)&concat(TABLE_NAME,chr(39)&', '&chr(39))&chr(39) as tabs resident  T2 where TABLE_TYPE='TABLE';
let tabs=peek('tabs',0,'T1'); // only load tables

for each tab in $(tabs)
sql select * from $(tab);
next  //select all fields from all tables

maybe use a qualify?

Regards