OraLoader with LONG RAW field

Discussion of open issues, suggestions and bugs regarding ODAC (Oracle Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
denis.willard
Posts: 2
Joined: Wed 06 Aug 2008 17:22

OraLoader with LONG RAW field

Post by denis.willard » Wed 06 Oct 2010 11:48

I'm trying to user à TOraLoader component to copy data from a table to another.

One of the fields is a "LONG RAW" field.

Is it possible to use a TOraLoader component to load data in a "LONG RAW" field ?

AlexP
Devart Team
Posts: 5530
Joined: Tue 10 Aug 2010 11:35

Post by AlexP » Wed 06 Oct 2010 13:22

Hello,

Now TOraLoader doesn't support working with the LONG RAW data type.
We will consider the possibility to add support for this type in one of the next ODAC versions.

denis.willard
Posts: 2
Joined: Wed 06 Aug 2008 17:22

Post by denis.willard » Mon 11 Oct 2010 11:47

So I cannot use the TOraLoader component...

What is the best way to copy data from a table to another one, when there is a LONG RAW field ?
My table contains a lot of records (about 500 000) and the time spent in this operation is a critical issue for me... and I bought ODAC components specially for that...

AlexP
Devart Team
Posts: 5530
Joined: Tue 10 Aug 2010 11:35

Post by AlexP » Mon 11 Oct 2010 13:35

Hello,

To transfer a large volume of data you can use the following code:

OraQuery1.SQL.TEXT := 'SELECT FIELD1, FIELD2,...,FIELD_LONG_RAW1, ... FROM TABLE1';
OraQuery1.open;
OraQuery1.First;
OraQuery2.SQL.TEXT:= 'SELECT FIELD1, FIELD2,...,FIELD_LONG_RAW1, ... FROM TABLE2';
OraQuery2.SQLInsert.Text:= 'INSERT INTO TABLE2(FIELD1, FIELD2,...,FIELD_LONG_RAW1, ...) VALUES(:FIELD1, :FIELD2,...,:FIELD_LONG_RAW1, ...)';
OraQuery2.CachedUpdates:= True;
OraQuery1.Options.UpdateBatchSize:= 100;
OraQuery2.open;
While not OraQuery1.Eof do
begin
OraQuery2.Append;
OraQuery2.FieldByName('FIELD1').Assign(OraQuery1.FieldByName('FIELD1'));
OraQuery2.FieldByName('FIELD2').Assign(OraQuery1.FieldByName('FIELD2'));
...
OraQuery2.FieldByName('FIELD_LONG_RAW1').Assign(OraQuery1.FieldByName('FIELD_LONG_RAW1'));
...
OraQuery2.Post;
OraQuery1.Next;
end;
OraQuery2.ApplyUpdates;

In this case records will be inserted as a PL/SQL block on 100 rows at a time (rows count is set in the OraQuery1.Options.UpdateBatchSize parameter), LONG RAW data will be inserted correctly.

Post Reply