How to store big table data?
Posted: Tue 27 Oct 2009 10:11
Dear sirs!
I try to store table data in a file to transfer it to another database using "SaveToXML" into a memory stream, compress it and store it to a file. This works as long as table data is not too big, but now I had to store more than 1 million rows and so I get out of memory.
Is there any way (cursor or so) to divide the data into several peaces, so that I will not run out of memory?
Here is an example: (ms1 is my memory stream)
qryDaten.Close;
qryDaten.FetchRows := 500;
qryDaten.SQL.Text := 'SELECT * FROM ' + tablename;
qryDaten.Open;
ms1.Clear;
qryDaten.SaveToXML(ms1);
ms1.Position := 0;
Compress1.CompressStreamToArchive(filename,ms1,tablename + '.DAT',coLH5);
Thx in advance
Moehre
I try to store table data in a file to transfer it to another database using "SaveToXML" into a memory stream, compress it and store it to a file. This works as long as table data is not too big, but now I had to store more than 1 million rows and so I get out of memory.
Is there any way (cursor or so) to divide the data into several peaces, so that I will not run out of memory?
Here is an example: (ms1 is my memory stream)
qryDaten.Close;
qryDaten.FetchRows := 500;
qryDaten.SQL.Text := 'SELECT * FROM ' + tablename;
qryDaten.Open;
ms1.Clear;
qryDaten.SaveToXML(ms1);
ms1.Position := 0;
Compress1.CompressStreamToArchive(filename,ms1,tablename + '.DAT',coLH5);
Thx in advance
Moehre