Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Loading tables

Hello,

now I have a file on the qlik sense desktop that I need to load all its tables in to the app so I can preview it and work on it.

the problem is that it has almost a 100 table with tons of rows so I am looking for a SQL Load statement to select the top 100 rows from each table at once.

Currently I am using this :

Select Top 100 *

From XYZ;

but that will take for ever plus typing mistakes can occur. so is there a one statement I can use.

note : that there is no qvd file the only source currently present is :

LIB CONNECT TO 'AG1';

thanks in advance. hope somebody can help soon.

Noha

2 Replies
Gysbert_Wassenaar

No, there's no one statement that you can use. You'll have to use an odbc connection and the odbc command SQLTABLES to create a table with a list of all the tables. Then you have to iterate through that new table and for each record in that table get the name of the source table you want to load from your source database and load the first 100 records.

Something like this maybe:

LIB CONNECT TO 'AG1';


TableList:

SQLTABLES;


For i = 1 to NoOfRows('TableList')


     LET vTableName = Trim(FieldValue('TABLE_NAME',$(i)));

     FIRST 100

     SQL SELECT * FROM $(vTableName);


Next


DROP TABLE TableList;


talk is cheap, supply exceeds demand
Not applicable
Author

Thanks for the reply but connecting to Sql is an option I can't even try

Thanks