I have a TClientDataSet with several records, and I want o load all the records, but load the blob field on Demand, one at a time.
I noticed that calling FetchBlobs twice fetches the blob twice and also that checking the field's IsNull property always returns False.
So the only solution I found so far is to access a property like Value or BlobSize and if the blob has not been fetched an exception is raised EDBClient with message "Blob has not been fetched", so if this exception is raised I call the FetchBlobs.
Is there some better way of doing this?
try
cdsIMG.BlobSize;
except
on E: EDBClient do
cds.FetchBlobs;
end;