I am converting files for an entire application and modified my conversion program to use a TOracleDirectPathLoader instead of inserts. However, when I run it I almost always get an exception EOracleError with message 'ORA-01438: value larger than specified precision allows for this column.
I wrote a separate test program for one of the smaller files. When I process the first four fields everything works fine but when I add a currency field I get the above message.
Because I am dealing with records of widely varying formats I am loading the records into a string array for conversion. This is working fine except for the Currency field. Here is a section of the code:
Row,Pos: Integer;
S: String;
R: array [0..30000] of String;
...
Loader.GetDefaultColumns(True);
Loader.Prepare;
...
Readln(F,S);
R[Row] := S;
Loader.ColumnByName('CaseNo').SetData(Row,@R[Row,1],8);
Loader.ColumnByName('Amount').SetData(Row,@R[Row,9],12);
if Row = Loader.MaxRows then
begin
LoadRows;
Row := 0;
end
else
Inc(Row);
...
There are actually more fields but I am only showing two in the above example. Here is what the text record looks like:
00000001000000000.00
00000002000000005.00
00000003000000010.00
Here are the oracle field definitions:
CaseNo Number(8,0)
Amount Number(11,2)
Also, the Loader columns always shows a size 1 greater than what I have specified. Normally this does not seem to cause a problem.
What am I doing wrong?
Thanks
I wrote a separate test program for one of the smaller files. When I process the first four fields everything works fine but when I add a currency field I get the above message.
Because I am dealing with records of widely varying formats I am loading the records into a string array for conversion. This is working fine except for the Currency field. Here is a section of the code:
Row,Pos: Integer;
S: String;
R: array [0..30000] of String;
...
Loader.GetDefaultColumns(True);
Loader.Prepare;
...
Readln(F,S);
R[Row] := S;
Loader.ColumnByName('CaseNo').SetData(Row,@R[Row,1],8);
Loader.ColumnByName('Amount').SetData(Row,@R[Row,9],12);
if Row = Loader.MaxRows then
begin
LoadRows;
Row := 0;
end
else
Inc(Row);
...
There are actually more fields but I am only showing two in the above example. Here is what the text record looks like:
00000001000000000.00
00000002000000005.00
00000003000000010.00
Here are the oracle field definitions:
CaseNo Number(8,0)
Amount Number(11,2)
Also, the Loader columns always shows a size 1 greater than what I have specified. Normally this does not seem to cause a problem.
What am I doing wrong?
Thanks