Sometimes I need to pull in a long list of tables or views and I want to pull in all the fields available to me. A fast and easy way to do this is by simply looping through all of them with load ‘*’ (all).
The names of the tables or views being pulled should be listed in the inline table. They will be looped through in the following section of code.
LOAD * INLINE [
Let vTableCount = NoOfRows(‘Tables’);
The load first checks for how many times to run its loop based on the numbers of rows in the table. This was handled through the vTableCount variable at the end of the inline table’s script, the function sets the number.
From there, the load loops through each name in the list and loads * (all). Once the data is loaded into the qvw, the QVD is stored with the same names as in the tablename list. The location of the QVD folder is set with the vQVD variable, which should be declared at the start of the script. After the QVD is stored, the data is then dropped from the qvw. The process then loops for the next view.
For i = 0 To $(vTableCount)-1
LET vMyTableName = Peek(‘TableNames’, $(i), ‘Tables’);
SQL SELECT * FROM $(vMyTableName);
STORE $(vMyTableName) INTO $(vQVD)$(vMyTableName).QVD (QVD);
DROP Table $(vMyTableName);