I often do large Oracle database queries using FireDAC to analyze registration data about our products and customers. Most of the time I am only processing through millions of rows to create a report or chart. One of the FDQuery properties that I forget to set True is the TDFQuery's "Unidirectional" sub-property found under the FetchOptions (TFDFetchOptions) property. By default Unidirectional is set to false as some developers will want to put the data into a grid or other container and update the values.
In my case, when I left Unidirectional false and read through millions of rows returned using my query, I was getting an "out of memory" error. Setting Unidirectional to true tell FireDAC not to cache the rows and my app never runs out of memory.
You can find more information about the Unidirectional property on the FireDAC docwiki and FAQ:
- http://docwiki.embarcadero.com/Libraries/Seattle/en/FireDAC.Stan.Option.TFDFetchOptions.Unidirectional
- http://docwiki.embarcadero.com/RADStudio/Seattle/en/Fetching_and_Populating_Questions_(FireDAC)
Have fun using FireDAC in your RAD Studio, Delphi and C++Builder 10 Seattle projects.
[DownloadButton Product=’RAD’ Caption=’Download the Free Trial of RAD Studio 10 Seattle’]
[BuyButton Product=’RAD’ Caption=’Purchase RAD Studio 10 Seattle – special offers are available until the end of 2015!’]