My code works good for 2 years but I got some problem on reading blob from sqlite file.
It works good for before sqlilte file as usual.
unidac options which I change are "Direct - True", "UseUnicode-True"
sqlite file has some korean character then I set UseUnicode is true
sqlite file version is 3.11.0 ("select sqlite_version();")
sqlite db tool is "db browser for sqlite 3.9.1" and it shows that the blob filed's length is 1081 bytes.
my old sqlite file has same row and it's length is 1081 bytes too.
my code work good on old sqlite file. it reads 1081 bytes correct.
but my code don't work on new sqlite file. it reads only 624 bytes.
original data bytes are below.
30 33 38 30 41 44 41 44 FE 06 D6 AE 61 A0 90 BF
but delphi xe3 watch on debugging show below.
30 00 33 00 38 00 30 00 41 00 44 00 41 00 41 00 FD FF 06 00 AE 05
why this occur?
my code parts is below. Move data from Sqlite file to Oracle.
Code: Select all
function TMBPConvForm.MakeFMUTable_FRM : boolean;
var
Buffer: TValueBuffer;
begin
try
qrFuelMap.SQL.Text := 'select ID, FRMAP, ENCRYPTIONDATA from FRMap order by ID ';
qrFuelMap.Open;
conUbiKhan.StartTransaction;
try
qrUbiKhan.SQL.Text := 'insert into UBIKHANS.TBL_ECO_FMUFRM (FRMCODE, FRMDATA) values ( :FRMCODE, :FRMDATA)';
qrFuelMap.First;
while not qrFuelMap.Eof do
begin
if Length(qrFuelMap.Fields[1].AsString) <= 8 then
begin
qrUbiKhan.ParamByName('FRMCODE').AsString := qrFuelMap.Fields[1].AsString;
qrUbiKhan.ParamByName('FRMDATA').AsBlob := qrFuelMap.Fields[2].AsBytes;
qrUbiKhan.ExecSQL;
end;
qrFuelMap.Next;
end;
conUbiKhan.Commit;
Result := true;
except
on E: Exception do
begin
conUbiKhan.Rollback;
ShowMessage('FMU의 FRMDATA 데이터 생성에 실패했습니다. 다시 시도해보십시오.' + #13#10 + E.Message);
Result := false;
end;
end;
finally
qrFuelMap.Close;
end;
end;
I tried to another sqlite driver to solve this problem.
I set the option.
Direct -- false
ClientLibrary -- directory & file name which download from https://www.sqlite.org/download.html
Delphi XE3 show error can't find sqlite3.dll.
I wanna solve this issue.
if you want that database file or source I can offer.