Recent

Author Topic: TSQLQuery.SavetoStream and PacketRecords  (Read 3095 times)

taqtaq

  • New Member
  • *
  • Posts: 13
TSQLQuery.SavetoStream and PacketRecords
« on: December 08, 2012, 04:00:54 pm »
How does TSQLQuery.savetostream?

I try to save into a file a dataset with 10 records but when I use SaveToStream, it saves the entire contents of the table.

For example, with a TSQLQuery.packetrecord := 10 and a Table with 10,000 records, savetostream saves into the file 10000 records.

I just want to save the 10 records that are loaded in the TSQLQuery

Thanks

goodname

  • Sr. Member
  • ****
  • Posts: 297
Re: TSQLQuery.SavetoStream and PacketRecords
« Reply #1 on: December 08, 2012, 04:58:44 pm »
The TSQLQuery.packetrecord := 10 means that ten records are loaded at a time. More are loaded as required. If you only want 10 then modify the query to return 10 records at a time. This gets database specific but common SQL key words are TOP and LIMIT.

taqtaq

  • New Member
  • *
  • Posts: 13
Re: TSQLQuery.SavetoStream and PacketRecords
« Reply #2 on: December 08, 2012, 07:01:09 pm »
Thanks for your quickly answer.
I see you're right
But maybe I have to create a routine to save only what is in memory
Thank again

 

TinyPortal © 2005-2018