Please consider the simplified Attached sample showing that a blob field is not correctly saved to an SQLite DB.
Specs: Delphi XE3 32-Bit, DA 7.0.67.1073, UniDac 4.6.12 with SQLite driver:
Insert stream in table
Apply updates
Reload the DB
Checking values added via table [FieldByName(‘value’).LoadFromStream] are identical
–> OK
Checking values added via server [aCustomCommand.ParamByName(‘value’).LoadFromStream(aStream)] are identical
–> ERROR, table value’s size is 0 instead of 298600
See stream insertion code in fServerDataModule.pas: procedure TServerDataModule.ConnectionManagerConnectionCreated.
Hello,
Database has changed: it now uses Blob field. The problem is when the server tries to add data in the DB using the following commands, not when the client uses a TDAMemDataTable:
procedure TServerDataModule.ConnectionManagerConnectionCreated(…)
begin
…
aCustomCommand := Connection.NewCommand(‘command2’, stSQL, ‘Custom’);
aCustomCommand.SQL := ‘INSERT INTO test VALUES (:id, :value)’;
aCustomCommand.RefreshParams;
aCustomCommand.ParamByName(‘id’).Value := ‘0’;
aCustomCommand.ParamByName(‘value’).BlobType := dabtBlob;
aCustomCommand.ParamByName(‘value’).LoadFromStream(aStream);
aCustomCommand.Execute;
…
end;
Please see the fServerDataModule.pas file in the sample I sent you.
Also the problem is in saving the DB not loading it: when I open the SQLite DB created using SQLiteSpy for example (located at c:\tmp\testdb.db3) and I do the following query, I get a 0 length value: