TSQLQuery.SavetoStream and PacketRecords lazarus / 16-Databases ---------------------------------------------------------------------- taqtaq · 2012-12-08 15:00 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 · 2012-12-08 15:58 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 · 2012-12-08 18:01 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