You are not logged in.
Pages: 1
Hi,
It seems that batch mode doesn't support adding/updating BLOB data, right? If so, is there a way to do that? That'll be extremely useful. Thanks.
Delphi XE4 Pro on Windows 7 64bit.
Lazarus trunk built with fpcupdelux on Windows with cross-compile for Linux 64bit.
Offline
Offline
Thanks ab. The first link is broken. I went through the second forum post.
In short, if I use TByteDynArray instead of TSQLRawBlob as the type for my binary fields, the binary data will be transferred by BatchAdd() and BatchUpdate(), is this correct? Thanks again!
Delphi XE4 Pro on Windows 7 64bit.
Lazarus trunk built with fpcupdelux on Windows with cross-compile for Linux 64bit.
Offline
No, use TSQLRawBlob, but specify the BLOB fields to the CustomField list of the BATCH Add method.
As clearly documented:
/// create a new member in current BATCH sequence
// - work in BATCH mode: nothing is sent to the server until BatchSend call
// - returns the corresponding index in the current BATCH sequence, -1 on error
// - if SendData is true, content of Value is sent to the server as JSON
// - if ForceID is true, client sends the Value.ID field to use this ID for
// adding the record (instead of a database-generated ID)
// - if Value is TSQLRecordFTS3, Value.ID is stored to the virtual table
// - Value class MUST match the TSQLRecordClass used at BatchStart,
// or may be of any kind if no class was specified
// - BLOB fields are NEVER transmitted here, even if ForceBlobTransfert=TRUE
// - if CustomFields is left void, the simple fields will be used; otherwise,
// you can specify your own set of fields to be transmitted when SendData=TRUE
// (including BLOBs, even if they will be Base64-encoded within JSON content) -
// CustomFields could be computed by TSQLRecordProperties.FieldBitsFromCSV()
// or TSQLRecordProperties.FieldBitsFromRawUTF8(), or by setting ALL_FIELDS
// - this method will always compute and send TCreateTime/TModTime fields
function Add(Value: TSQLRecord; SendData: boolean; ForceID: boolean=false;
const CustomFields: TSQLFieldBits=[]; DoNotAutoComputeFields: boolean=false): integer;
Offline
Great! I see now, thanks ab!
Delphi XE4 Pro on Windows 7 64bit.
Lazarus trunk built with fpcupdelux on Windows with cross-compile for Linux 64bit.
Offline
Pages: 1