Unidac 4.6.11 VirtualTable can not load oracle blob data in Win32 XE3
Unidac 4.6.11 VirtualTable can not load oracle blob data in Win32 XE3
Unidac 4.6.11 VirtualTable can not load oracle blob data in Win32 XE3
--Oracle table
create table t1(
id number(9) not null,
graphic blob,
primary key (id)
);
--insert some pictures
//Delphi XE3(32),Oracle Blob
//Test VirtualTable1.SaveToStream VirtualTable1.LoadFromStream
//It not correct
procedure TForm39.SpeedButton1Click(Sender: TObject);
var
stream: TMemoryStream;
filename: string;
begin
stream := TMemoryStream.Create;
try
UniQuery1.Close;
UniQuery1.Open;
VirtualTable1.Assign(UniQuery1);
VirtualTable1.SaveToStream(stream);
VirtualTable1.LoadFromStream(stream);
VirtualTable1.Open;
while not VirtualTable1.Eof do
begin
filename := 'c:\' + VirtualTable1.FieldByName('id').AsString + '.jpg';
TBlobField(VirtualTable1.FieldByName('graphic')).SaveToFile(filename);
VirtualTable1.Next;
end;
VirtualTable1.Close;
finally
stream.Free;
end;
VirtualTable1.Open;
end;
//Test VirtualTable1.SaveToFile VirtualTable1.LoadFromFile
//It not correct
procedure TForm39.SpeedButton2Click(Sender: TObject);
var
filename: string;
begin
UniQuery1.Close;
UniQuery1.Open;
VirtualTable1.Assign(UniQuery1);
VirtualTable1.SaveToFile('c:\1.vtd');
VirtualTable1.LoadFromFile('c:\1.vtd');
VirtualTable1.Open;
while not VirtualTable1.Eof do
begin
filename := 'c:\' + VirtualTable1.FieldByName('id').AsString + '.jpg';
TBlobField(VirtualTable1.FieldByName('graphic')).SaveToFile(filename);
VirtualTable1.Next;
end;
VirtualTable1.Close;
end;
--Oracle table
create table t1(
id number(9) not null,
graphic blob,
primary key (id)
);
--insert some pictures
//Delphi XE3(32),Oracle Blob
//Test VirtualTable1.SaveToStream VirtualTable1.LoadFromStream
//It not correct
procedure TForm39.SpeedButton1Click(Sender: TObject);
var
stream: TMemoryStream;
filename: string;
begin
stream := TMemoryStream.Create;
try
UniQuery1.Close;
UniQuery1.Open;
VirtualTable1.Assign(UniQuery1);
VirtualTable1.SaveToStream(stream);
VirtualTable1.LoadFromStream(stream);
VirtualTable1.Open;
while not VirtualTable1.Eof do
begin
filename := 'c:\' + VirtualTable1.FieldByName('id').AsString + '.jpg';
TBlobField(VirtualTable1.FieldByName('graphic')).SaveToFile(filename);
VirtualTable1.Next;
end;
VirtualTable1.Close;
finally
stream.Free;
end;
VirtualTable1.Open;
end;
//Test VirtualTable1.SaveToFile VirtualTable1.LoadFromFile
//It not correct
procedure TForm39.SpeedButton2Click(Sender: TObject);
var
filename: string;
begin
UniQuery1.Close;
UniQuery1.Open;
VirtualTable1.Assign(UniQuery1);
VirtualTable1.SaveToFile('c:\1.vtd');
VirtualTable1.LoadFromFile('c:\1.vtd');
VirtualTable1.Open;
while not VirtualTable1.Eof do
begin
filename := 'c:\' + VirtualTable1.FieldByName('id').AsString + '.jpg';
TBlobField(VirtualTable1.FieldByName('graphic')).SaveToFile(filename);
VirtualTable1.Next;
end;
VirtualTable1.Close;
end;
Re: Unidac 4.6.11 VirtualTable can not load oracle blob data in Win32 XE3
if Field <> nil then
case Field.DataType of
ftBlob:
Field.AsBytes := St;
ftString, {ftBlob,} ftMemo:
Field.{$IFDEF VER12P}AsAnsiString{$ELSE}AsString{$ENDIF} := Encoding.Default.GetString(St);
case Field.DataType of
ftBlob:
Field.AsBytes := St;
ftString, {ftBlob,} ftMemo:
Field.{$IFDEF VER12P}AsAnsiString{$ELSE}AsString{$ENDIF} := Encoding.Default.GetString(St);
Re: Unidac 4.6.11 VirtualTable can not load oracle blob data in Win32 XE3
Hello,
We cannot reproduce the issue using either the SaveToStream/LoadFromStream or SaveToFile/LoadFromFile methods. BLOB data (images) are saved correctly with the code you have provided
Please describe the problem in greater detail: the error occurs when saving, the file is saved incorrectly, etc.
We cannot reproduce the issue using either the SaveToStream/LoadFromStream or SaveToFile/LoadFromFile methods. BLOB data (images) are saved correctly with the code you have provided
Code: Select all
TBlobField(VirtualTable1.FieldByName('graphic')).SaveToFile(filename);Re: Unidac 4.6.11 VirtualTable can not load oracle blob data in Win32 XE3
The same code in My PC(Unidac 4.6.11,Win32 XP,Delphi XE3_Update1)do not display correctly. But,run in Delphi XE is correctly. I Modify the following code.It can run correctly in both XE/XE3_u1.
procedure TVirtualTable.LoadFromStream(Stream: TStream; LoadFields: boolean);
...
if Field <> nil then
case Field.DataType of
ftBlob: Field.AsBytes := St;
ftString, ftMemo:
Field.{$IFDEF VER12P}AsAnsiString{$ELSE}AsString{$ENDIF} := Encoding.Default.GetString(St);
procedure TVirtualTable.LoadFromStream(Stream: TStream; LoadFields: boolean);
...
if Field <> nil then
case Field.DataType of
ftBlob: Field.AsBytes := St;
ftString, ftMemo:
Field.{$IFDEF VER12P}AsAnsiString{$ELSE}AsString{$ENDIF} := Encoding.Default.GetString(St);
Re: Unidac 4.6.11 VirtualTable can not load oracle blob data in Win32 XE3
Hello,
We cannot reproduce the problem with the code you have provided, graphic data are loaded to VT correctly and are saved on drive both with XE and XE3. Please send us a small sample demonstrating the problem (including the table creation script) to alexp*devar*com
We cannot reproduce the problem with the code you have provided, graphic data are loaded to VT correctly and are saved on drive both with XE and XE3. Please send us a small sample demonstrating the problem (including the table creation script) to alexp*devar*com
Re: Unidac 4.6.11 VirtualTable can not load oracle blob data in Win32 XE3
I have send a email for you. It Contains demo and orale dmp.
Re: Unidac 4.6.11 VirtualTable can not load oracle blob data in Win32 XE3
Hello,
I have received your demo project - all three samples work correctly. Please specify your exact version of XE3 (whether Update 1 is installed or not).
I have received your demo project - all three samples work correctly. Please specify your exact version of XE3 (whether Update 1 is installed or not).
Re: Unidac 4.6.11 VirtualTable can not load oracle blob data in Win32 XE3
Thank you!I think that may be the Chinese Windows XP caused.I modify code of VirtualTable, now It can work correctly