How to know in advance if data would fit in a DataSet

MarceloM

Member
Hi! How could I know in advance if a query result would fit in memory before opening, preventing from obtaining a EMemory... error and wasting time. I run a count(*) query before and multiply it by Dataset.recordsize, but I don't know what to compare it to. Delphi 7 DOA 4.
Thanks!
 
Last edited:
That will be difficult. If you set TOracleDataSet.QueryAllRecords to False you can explicitly fetch the records in you application by performing a DataSet.Next loop. This way you can monitor the application memory usage and take action if it becomes "too much".

The DataSet.RecordSize is not a good measure because it does not include the size of all fields (e.g. CLOB's and BLOB's).
 
Back
Top