Exception ORA-01438 on TOracleDirectPathLoader.Load

indigo

Member²
I am trying to use TOracleDirectPathLoader but an exception EOracleError with message 'ORA-01438: value larger than specified precision allows for this column.
Followed by ORA-01001: invalid cursor.
This occurs when Loader.Load(Row) is executed. What am I doing wrong?

Thanks

while not Eof(F) ...
Readln(F,S);
Memo1.Lines.Add(S);
S := IntToStr(Row);
Loader.ColumnByName('BatchNo').SetData
(Row,@S[1],10);
Loader.ColumnByName('AccountNo').SetData
(Row,@S[11],8)
...
Inc(Row);
if (Row = Loader.MaxRows) then
...
 
This is a common mistake. The SetData function does not copy the data, but merely assigns a data pointer and length to a cell in the loader array. When Load is called, this piece of memory still needs to hold the actual data, and this is clearly not the case here. The DirectPath Demo project defines an internal collection class to hold a batch of record data, which is then loaded. Maybe you can use this as a guideline.

------------------
Marco Kalter
Allround Automations
 
Back
Top