Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Dear All,
Here I am loading multiple QVDs at one time eg ( *_Item), the issue which I am facing is that one particular Field is missing from some of the Qvds.
Is there anyway where I can find from which qvd the particular coloumn is missing?
As there are huge number of QVDs it is not possible to check each QVD.
Tried to find through log but still couldn't.
Any help is appreciated.
Thanks a lot.
You will need to load the QVDs using
ForEach vFile in FileList(....)
rather than using a wildcard load. You could use QVDNoOfFields('$(vFile)') to determine if the field exists and branch to a conditional load that does not load the problem field. Or load with a LOAD *, but either way you will need to load with a concatenate statement to force the load into one table. Something like:
Set vConc = 'Data:';
ForEach vFile In FileList('... path and file miask ...')
If Alt(NoOfRow('Data'), 0) > 0 Then
Set vConc = 'Concatenate(Data)';
End If
$(vConc)
LOAD * FROM [$(vFile)] (qvd);
next
If your qvd's aren't very big so that you don't really needs optimized loadings you could simply use filebasename() as Source within the lad-statement. If the qvd's really big you could use qvd-file-functions like QvdNoOfFields() and QvdFieldName() to loop through the xml-header from each qvd, maybe in this way:
for each vQVD in Filelist(....)
for i = 1 to QvdNoOfFields('$(vQVD)')
let vField = QvdFieldName('$(vQVD)', $(i))
..... // your checks - maybe loading into another file
....
- Marcus
This process will also show you the names of the files in the log file, so you'll be able to identify which table fails
Imagine that the only discrepancy is that sometimes one or more columns are missing, you can use this:
LET vExpectedNoOfFields = 12: // Change this to the correct number of fields
FOR EACH vQVDFile in FileList('path-and-mask') // Enter the QVD location
IF QvdNoOfFields('$(vQVDFile)') <> $(vExpectedNoOfFields) THEN
TRACE >>> File [$(vQVDFile)] does not have enough Fields!!! <<< ;
END IF
NEXT
Enable Log file generation, run the script and look in the log for all lines that start with >>>
Peter