Save/Load a blob from a ClientDataset not possible ??
Posted: Mon 14 Jan 2008 12:51
Hello, i try to use odac with the TClientDataset to update some database, but i have a big problem :
all is working, except blob fields (clob is ok)...
- I have a clientDataset, Linked with a TOraProvider who is linked to a TOratable.
- My fisrt step is to generate the cliendataset file, here is a sample :
Table TEST with COLUMN1 & COLUMN2 as Varchar2 and DATABLOB as Blob.
at this step, my clientdataset file is well generated then to sychronize with my database :
With this code, ApplyUpdates freeze the application and sometimes send a ORA-12571 error...
Note :
- If i remove the blob insertion all is ok.
- With Clob it is working
- same code under Firebird database is working
Do you have idea ? this is a critical issue for me
Many Thanks !!
(ps : Odac v6.25.0.6)
all is working, except blob fields (clob is ok)...
- I have a clientDataset, Linked with a TOraProvider who is linked to a TOratable.
- My fisrt step is to generate the cliendataset file, here is a sample :
Table TEST with COLUMN1 & COLUMN2 as Varchar2 and DATABLOB as Blob.
Code: Select all
ClientDataSet1 := TClientDataSet.Create(Self);
with ClientDataSet1 do begin
ProviderName := 'OraProvider1';
StoreDefs := False;
IndexDefs.Add('IDX1', 'ID', []);
end;
ClientDataSet1.Open;
ClientDataSet1.Insert;
ClientDataSet1.FieldByName('ID').Value := 1;
ClientDataSet1.FieldByName('COLUMN1').Value := 'Test INSERT...';
ClientDataSet1.FieldByName('COLUMN2').Value := '...of a Blob';
try
FS := TFileStream.Create('c:\img.jpg', fmOpenRead);
FS.Position := 0;
TBlobField(ClientDataSet1.FieldByName('DATABLOB')).BlobType := ftOraBlob;
TBlobField(ClientDataSet1.FieldByName('DATABLOB')).LoadFromStream(FS);
ClientDataSet1.Post;
finally
FS.Free;
end;
ClientDataSet1.SaveToFile('c:\cds.bin', dfBinary);
ClientDataSet1.Free;
Code: Select all
ClientDataSet1 := TClientDataSet.Create(Self);
with ClientDataSet1 do begin
ProviderName := 'OraProvider1';
StoreDefs := False;
IndexDefs.Add('IDX1', 'ID', []);
OnReconcileError := ClientDataSet12ReconcileError;
end;
ClientDataSet1.FileName := 'c:\cds.bin';
ClientDataSet1.Open;
ClientDataSet1.First;
ClientDataSet1.ApplyUpdates(-1);
ClientDataSet1.Close;
OraSession.Commit;
ClientDataSet1.free;
Note :
- If i remove the blob insertion all is ok.
- With Clob it is working
- same code under Firebird database is working
Do you have idea ? this is a critical issue for me
Many Thanks !!
(ps : Odac v6.25.0.6)