Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I need to store data from QVD into CSV. Using below query i could able to generate csv file, but how to split the file into multiple when we reach the row limit in CSV or in excel or in any format.
If anybody has worked or have solution, let me know. It will be great help...
Hi,
In general excel will have some limited number of rows, and so I dont think so if QVD having more number of records can export in CSV.
Hi,
well, if you know the limit of the target_format you can just include a row_counter in the table and if the limit is reached, some routine has to be called to split the table. The only difficulty is avoiding a giant synthetic key when you split the table into several.
HTH
Try like:
tablename1:
First 10000 Load * from <qvd>;
Store tablename1 <tablename1>(txt,delimiter is ';') // or use where clause like shown below
tablename2:
Load * from <qvd> where recno()>10000;
Store tablename2 <tablename2>(txt,delimiter is ';')
If you want to split the qvd you will need a load-loop over the qvd then the store-command itself had no option for limiting the store in any kind. The follwing routine isn't tested and might need some small syntax- and logical adjustments but in general the logic should work:
let vQVDFile = 'D:\Folder\File.qvd';
let vQVDRecordsTotal = QvdNoOfRecords( '$(vQVDFile)' );
let vQVDRecords = 65532;
let vLoadCounter = 0;
for i = 1 to vQVDRecordsTotal step vQVDRecords
csvFile:
Load * From $(vQVDFile) (qvd) where recno() >= $(i) and recno() < $(i) + vQVDRecords;
let vLoadCounter = $(vLoadCounter) + 1
store csvFile into csvFile_$(vLoadCounter).csv (txt);
drop table csvFile;
next
- Marcus