Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Scenario:
1. Loading an inline table without naming it.
LOAD * INLINE[
A
1
2
3
];
2. Then, loading a regular table:
xyz:
load *
resident ABC;
3. Then, again loading an inline table without naming it:
LOAD * INLINE[
B
1
2
3
];
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.
Interesting part:
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).
Any comments/views?
Thanks,
Siddharth
Siddharth,
could you please post also the code snippet for step 4, storing all tables by using the loop, since this seems to be a crucial part of the issue.
Regards,
Stefan
for i = 0 to NoOfTables() -1
LET vTableName= TableName( $( i ) );
LET vOutfile= '$(vTableName).qvd'
STORE vTableName into [QVD\vOutfile] (qvd);
next i
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);
next i
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.
Hope this helps,
Stefan
Swuehi,
The looping is correct...I have tested n used it successfully before.
Secondly, the resident load was just an example....All 4 tables have different table/field names, so that is not an issue.
Neways, thanks for taking the time.
Siddharth
Ok, let's go back to the beginning:
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.
So,
- 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?
Regards,
Stefan