Create OraLoader at Runtime

Discussion of open issues, suggestions and bugs regarding ODAC (Oracle Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
reini

Create OraLoader at Runtime

Post by reini » Thu 24 Mar 2005 09:15

Hi,

when creating the OraLoader at Runtime i get "unknown identifier" for the OraLoader.Column.size and OraLoader.Column.datatype.

Is it necessary to set the size, because it works also without setting the size.

We use ODAC 5.50.0.15 / D7 / XP SP1 / Ora 8.1.7

Thanks in advance,
reini

Code: Select all

  OraLoader := TOraLoader.Create(Self);
  with OraLoader do
  begin
    Name := 'OraLoader';
    Session := OraSession;
    TableName := 'MYTABLE';

    with Columns.Add do begin
      Name := 'FIELD1';
      DataType := ctString;   //-> unknown identifier
      Size := 20;    //-> unknown identifier
    end;

    LoadMode := lmDML;
    OnPutData := OraLoaderPutData;
  end;

Paul
Posts: 725
Joined: Thu 28 Oct 2004 14:06

Post by Paul » Thu 24 Mar 2005 10:14

Columns.Add is a method of TCollection and returns TCollectionItem. You must convert it to TDPColumn

reini

Create OraLoader at Runtime

Post by reini » Thu 24 Mar 2005 13:46

Hi again,

ok - the DataType works but the "convert to TDPColumn" ist not clear for me.

Could you give a short example.

Code: Select all

 
    MyOraLoader.Columns.Items[i].DataType := ctstring;
Thanks in advance.

Paul
Posts: 725
Joined: Thu 28 Oct 2004 14:06

Post by Paul » Thu 24 Mar 2005 14:11

Code: Select all

    with TDPColumn(Columns.Add) do begin 
      Name := 'FIELD1'; 
      DataType := ctString;
      Size := 20;  
    end; 

reini

Post by reini » Thu 24 Mar 2005 14:17

thanks a lot,

it works...

Post Reply