Page 1 of 1

Problem exporting CLOB field

Posted: Fri 07 Dec 2007 12:41
by JasonR
Hi.

I am using the VirtualTable and batchMove compents in conjunction with a DOA TOracleDataSet to export data from my oracle database to a file. (See code example)

Code: Select all

//==========================================//
procedure TMainForm.Export_ORA_Table(Table: String);
begin
  Try
    With TABLE_T do Begin
      Close;
      SQL.Clear;
      DeleteVariables;
      SQL.Add('SELECT * FROM ' + SCHEMA_L.Text + '.'  + Table);
      Open;
    End;
    VTABLE_T.Close;
    VTABLE_T.FieldDefs.Clear;
    VTABLE_T.FieldDefs := TABLE_T.FieldDefs;
    EXPORT_B.Execute;
    VTABLE_T.Open;
    VTABLE_T.SaveToXML(Table+ '.XML');
  Except
    On e : Exception do Begin
                          Showmessage('Could not export ' + Table + ' : ' +  e.Message);
                        End;
  End;
end;
//==========================================//
The problem is that we are using oracle CLOB flieds (as apposed to BLOB) to store richedit formatted fields. When the export routine encounters one of these types of fields I get the error : Field is not BLOB

Please advise.

Delphi Version : 7
OS : XP

I'm not sure which version of Virtualtable and batchmove I have, but they came with my IBDAC installation which (from the history) is version 2.10.0.10 02.08.07.

Thanks
Jason

Posted: Fri 07 Dec 2007 13:10
by JasonR
I think I solved my own problem :oops:

I replaced my code

Code: Select all

VTABLE_T.FieldDefs := TABLE_T.FieldDefs;
with :

Code: Select all

VTABLE_T.Assign(TABLE_T);
and that seems to work. I will test have to test it, but that looks like it did the trick :)