I have a TClientDataSet with multiple records, and I want o to load all the records, but load the blob field on demand, one at a time.
I noticed that calling FetchBlobs twice twice fetches a blob, and also that checking the IsNull property of a field always returns False.
Thus, the only solution I have found so far is to access a property, such as Value or BlobSize, and if blob has not been selected, the exception throws an EDBClient with the message "Blob was not retrieved", so if this exception is raised I call FetchBlobs
Is there a better way to do this?
try cdsIMG.BlobSize; except on E: EDBClient do cds.FetchBlobs; end;
source share