Page 1 of 1
OraLoader with LONG RAW field
Posted: Wed 06 Oct 2010 11:48
by denis.willard
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 ?
Posted: Wed 06 Oct 2010 13:22
by AlexP
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.
Posted: Mon 11 Oct 2010 11:47
by denis.willard
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...
Posted: Mon 11 Oct 2010 13:35
by AlexP
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.