Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I'm trying to list the name of table and number of records from qvds.
And I got it right for one qvd but unable to do it when I have multiple qvds.
Can someone suggest me a logic or sample code for this.
Note: There may be multiple qvds and all of them in different locations.
Regards,
Sachin
Something like this using the help section as Stefan pointed out:
SUB DoDir(Root)
For Each File in FileList(Root & '\*.qvd')
Let vQVDName = QvdTableName('$(File)');
Let vNumRows = QvdNoOfRecords('$(File)');
[Rec Count]:
LOAD *,
RowNo() as Key;
LOAD * INLINE [
QVD Table Name, No Of Records
$(vQVDName), $(vNumRows)
];
NEXT File
FOR Each Dir in DirList(Root&'\*')
Call DoDir(Dir)
NEXT Dir
END SUB
CALL DoDir ('C:\Users\sunny.a.talwar\Downloads\Test')
Taking what you did in the script, this should work. Change Cars.qvd and Emp.qvd to the file path
Let vQVDName = QvdTableName ('Cars.qvd');
Let vNumRows = QvdNoOfRecords('Cars.qvd');
Let vQVDName2 = QvdTableName ('Emp.qvd');
Let vNumRows2 = QvdNoOfRecords('Emp.qvd');
[Rec Count]:
LOAD * INLINE [
QVD Table Name, No Of Records
$(vQVDName), $(vNumRows)
$(vQVDName2), $(vNumRows2)
];
This is a simple and straightforward way (Quick and Dirty) of doing it:
Let vQVDName1 = QvdTableName ('Cars.qvd');
Let vNumRows1 = QvdNoOfRecords('Cars.qvd');
Let vQVDName2 = QvdTableName ('Emp.qvd');
Let vNumRows2 = QvdNoOfRecords('Emp.qvd');
[Rec Count]:
LOAD * INLINE [
QVD Table Name, No Of Records
$(vQVDName1), $(vNumRows1)
$(vQVDName2), $(vNumRows2)
];
Thanks Petter, but is there a way to automate it using a for loop or something like that.
For each vQVD in FileList ('*.qvd')
[Rec Count]:
LOAD
'$(vQVD)' as [QVD Table Name],
QvdNoOfRecords('$(vQVD)') as [No Of Records]
Autogenerate 1;Next vQVD
May be this:
Let vPathName = 'C:\Users\sunny.a.talwar\Downloads\Test\';
For Each File in FileList('$(vPathName)'&'*.qvd')
Let vQVDName = QvdTableName('$(File)');
Let vNumRows = QvdNoOfRecords('$(File)');
[Rec Count]:
LOAD * INLINE [
QVD Table Name, No Of Records
$(vQVDName), $(vNumRows)
];
NEXT File
Yes - swuehl just illustrated it ... good luck ![]()
Hi Sunny,
As usual appreciate thanks for the quick response.
But the issue here is some qvds are in sub folders as well like:
C:\Users\sunny.a.talwar\Downloads\Test\
C:\Users\sunny.a.talwar\Downloads\Test\Sub\
Any idea how to handle this scenario
Hi Stefan,
But my qvds are in different folders. Any idea how to handle this scenario.
Hi Pavan,
But I have n qvd's and all of them are in different locations.