Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi ,
need help on below issue
I have multiple QVD's each qvd column count is different .
EX:
In QVD1 I have 2 columns
Col A and Col B
In Qvd2 I have 3 columns
Col A ,Col B and Col C
I used script to load all QVD like
Test:
Load A,
B,
C
From Data\*.QVD;
now its giving error because Col C is not available in 1st QVD. please suggest is there any possibility to load the data in single Load stmt.
I know if i use concat I can achieve this but like this I have multiple Qvd's with different formats.
Hello!
Load * from....
set n = 0;
sub DoDir (Root)
for each File in filelist (Root&'\*.qvd')
n = n + 1;
QVD_$(n):
load * from $(File);
next File
for each Dir in dirlist (Root&'\*' )
call DoDir (Dir)
next Dir
end sub
call DoDir ('$(my_directory)')
I assume you want all the QVDs to be loaded into a single table. With different field lists, you will get mutiple tables and a messy composite key. I suggest that you load them in a loop and explicitly concatenate them:
Set vHeader = 'DataTable:';
ForEach vFile in FileList(Data\*.QVD)
$(vHeader )
LOAD * FROM [$(vFile)] (qvd);
Set vHeader = 'Concatenate(DataTable)';
Next
The vHeader settings concatenate all the files after the first one into the same table.
HTH
Jonathan
Hi Sudhakar,
You can use For loop to loop through each file in the directory and force concatenate all the tables. You can follow the script provided by jontydkpi.
Regards,
Jagan.
Hi Jonathan,
Thanks for your reply ..
can u please share the QVW file.
Sorry, I cannot upload files from here due to client's security policy. Just use the script I posted as is. It will load the contents of all the QVD files matching the FileList parameter into the [DataTable] table.