3. Then, again loading an inline table without naming it:
LOAD * INLINE[
4. After this i am storing all tables in the app to qvd's by using a loop(this works well. have tested it).
The load fails while the loop is creating d qvds, just after table xyz(xyw.qvd) is created , and there is no description regarding failure in d log. The code for step 3 is missing. Thats it!
NOW, If I NAME the inline tables(in steps 1,3) , and then load, the load DOESN'T FAIL.
I first thought, that the inline tables are assigned names after d file is saved, and hence d issue, as we are looping before they are named. But in that case, the load should have failed before (when d loop is creating d qvd for d first inline table).
Ok, I think I know what's going on (should have noticed that before).
First, I think your last snippet misses some dollar sign expansions in the STORE statement line:
for i = 0 to NoOfTables() -1
LET vTableName= TableName( $(i) );
LET vOutfile= '$(vTableName).qvd';
STORE $(vTableName) into [QVD\$(vOutfile)] (qvd);
But that's not the problem. In step 2, you are loading a resident table with exact same field names as the resident table shows, this will provoke an automatic concatenation. So, what you expect to be Table xyz is not the table loaded in step 2 (this one is, is said concatenated to table ABC).
The table name xyz is now applied to your next inline table load (step 3), which you can also see looking at the table viewer.
So the load does not fail, due to the concatenation you are getting one table less than expected and table names xyz contains the Step 3 INLINE table.
If you don't want to concatenate, rename some fields in step 2 or use NOCONCATENATE load prefix.
I understood from your original post, that your script runs without any error reported, right? And if you say "fail", you mean the qvd creation code for the step 3 table is not performed / missing.
- on what version of QV are you?
- have you tried stepping through the code calling the script debugger from editor?
I loaded a simple table from excel as table ABC, then executed your code above and the loop. With QV11, QV10SR2 and QV9, I got the same results: I got a concatenation for table ABC or, if I change field names, I get all tables stored in QVDs.
Since you are experiencing something different, I think your script code is essentially different from what I just described / assumed or from what you have posted.
So maybe you could create a sample qvw file that demonstrates the issue and upload it here?