Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
manojkulkarni
Partner - Specialist II
Partner - Specialist II

Store QVD data into CSV

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...

4 Replies
vardhancse
Specialist III
Specialist III

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.

datanibbler
Champion
Champion

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

tresesco
MVP
MVP

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 ';')

marcus_sommer

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