 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Enquiring Mind Guest
|
Posted: Mon Apr 23, 2007 3:01 pm Post subject: More blob questions |
|
|
Hi,
I have a few more questions about the handling of Blobs in dbExpress.
Suppose I have a table called Employees that includes an integer field
EmployeeIndex, a VarChar field EmployeeName, and a Blob field PhotoBlob.
Suppose that I have a SQL dataset SQLEmployees defined by the SQL command
'select * from Employees where (EmployeeIndex>:MaxEmployeeIndex -30)'
This is connected via DasetProvider dspEmployees to client dataset
cdsEmployees. Can anyone help to advise which of any of the following
suppositions are valid?
1. The statements SQLEmployees.Next and cdsEmployees.Open cause the in-line
fields of the record to be downloaded to the client, but not the Blob
fields, which are only fetched on demand. Thus after the Open statement, the
CDS will contain local copies of the fields EmployeeIndex and EmployeeName
for every record satisfying the Where clause in the SQL command, but will as
yet contain no Blob data.
2. The Blob field is downloaded the first time that the field is read. Thus
the statement
var
s: TMemoryStream
....
cdsEmployeesPhotoBlob.SaveToStream(S)
would first check to see whether the persistent TBlobField object
cdsEmployeesPhotoBlob already contains downloaded data. If it doesn't, it
would fetch the Blob data from the database and put it into the field
object's memory. It would finally copy the data from the field object to the
memory stream S.
3. After the execution of the previous statement the Blob data copied into
the cdsEmployees field will remain in existence until such time as
explicitly deleted. Thus if there is an AfterScroll event handler that
includes the code
var
Picture: TPicture;
....
ConvertBlobToPicture(cdsEmployeesPhotoBlob, Picture);
and I scroll though each record in the CDS, the CDS will end up having a
local copy of every record's blob field.
4. The Delta will contain copies of the Blob initially downloaded (if it
has been downloaded at all), and a copy of a new Blob input.
Thanks in advance for any clarification,
Enquiring Mind |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|