I am using Delphi 4, DOA 3.3.1 and Oracle 7.3. I have a table with a column of type NUMBER(12,2) and the bind variable "pc" is used to insert data into that column. Using a TOracleQuery component, I am trying to run a query like this:
with DM.oqryClaims do
begin
Close;
SQL.Clear;
DeleteVariables;
DeclareVariable('fn', otString);
DeclareVariable('rd', otDate);
DeclareVariable('pc', otString);
DeclareVariable('pdl', otInteger);
DeclareVariable('pnl', otInteger);
DeclareVariable('rl', otInteger);
DeclareVariable('pl', otInteger);
DeclareVariable('pc', otFloat);
SQL.Add('INSERT INTO CTS.CLMREMIT VALUES
fn, :rd,
c,
dl,
nl, ' +
':rl,
l,
c )');
SetVariable('fn', FileName);
SetVariable('rd', RunDate);
SetVariable('pc', PayCycle);
SetVariable('pdl', PaidLines);
SetVariable('pnl', PendLines);
SetVariable('rl', RejectLines);
SetVariable('pl', PLines);
SetVariable('pc', 68.42);
try
Execute;
exception
{Exception code here}
end;
end;
Whether I use a variable of type Real or specify a value like above, I get the ORA-01401 error - inserted value too large for column. I do not get this error if I insert NULL or 0. How can this happen when I try to insert 68.42 into a NUMBER(12,2) column? If I use SQL*PLUS and run this insert statement it works fine.
Is there a problem caused by DOA translating this value to a floating point type where there are more than 2 places to the right of the decimal? Please let me know if this is a DOA issue or not and what I can do to deal with this situation.
Thanks.
with DM.oqryClaims do
begin
Close;
SQL.Clear;
DeleteVariables;
DeclareVariable('fn', otString);
DeclareVariable('rd', otDate);
DeclareVariable('pc', otString);
DeclareVariable('pdl', otInteger);
DeclareVariable('pnl', otInteger);
DeclareVariable('rl', otInteger);
DeclareVariable('pl', otInteger);
DeclareVariable('pc', otFloat);
SQL.Add('INSERT INTO CTS.CLMREMIT VALUES




':rl,


SetVariable('fn', FileName);
SetVariable('rd', RunDate);
SetVariable('pc', PayCycle);
SetVariable('pdl', PaidLines);
SetVariable('pnl', PendLines);
SetVariable('rl', RejectLines);
SetVariable('pl', PLines);
SetVariable('pc', 68.42);
try
Execute;
exception
{Exception code here}
end;
end;
Whether I use a variable of type Real or specify a value like above, I get the ORA-01401 error - inserted value too large for column. I do not get this error if I insert NULL or 0. How can this happen when I try to insert 68.42 into a NUMBER(12,2) column? If I use SQL*PLUS and run this insert statement it works fine.
Is there a problem caused by DOA translating this value to a floating point type where there are more than 2 places to the right of the decimal? Please let me know if this is a DOA issue or not and what I can do to deal with this situation.
Thanks.