Additional
dbCAP
AnyDAC
ThinDAC
NCOCI8
Topic: "Numeric Value Out Of Range"
"Numeric Value Out Of Range"
Posted: 2005/08/09 16:14
 
Hello Dmitry

I'm using MS-SQL Server 8.00.760(SP3) on Windows 2000 Server (2195)

I got the "Numeric Value Out Of Range" Error from the Database

// Original Error Message
[AnyDAC][Phys][ODBC][Microsoft][ODBC SQL Server Driver]Numerische Werte außerhalb des zulässigen Bereichs.

when I'm using the Anydac Batch comands

ADQryTarget.BeginBatch;
ADQryTarget.EndBatch

during Inserts of about 4000 records.

I don't know whether it is related to this

http://support.microsoft.com/default.aspx?scid=kb;en-us;313352

or this

http://support.microsoft.com/default.aspx?scid=kb;en-us;236786

but the error does not happen without batch comands.

Do you have any hints?

regards Dirk
RE: "Numeric Value Out Of Range"
Posted: 2005/08/09 17:35
 
Hello Dirk !

Few questions:

1) Do you fill values of all fields ? Or some fields remains NULL ? Can you check failed records regarding that ?

2) Could you please turn tracing on and send output to me, please ?

3) I think, you use kind of that:
ADQryTarget.BeginBatch;
while ... do begin
ADQryTarget.Append;
.....
ADQryTarget.Post;
end;
ADQryTarget.EndBatch;
I will suggest to use AnyDAC array execution to move large volumes for data to the DB. You can find demo there - $(ADHOME)DEMOComp LayerTADQueryExecSQLBatch. Also AnyDAC_Architecture.pdf contains description.

Regards,
Dmitry
RE: "Numeric Value Out Of Range"
Posted: 2005/08/10 21:46
 
Hi Dmitry

I played with Array execution and It really looked good.

But, could you please explain this one to me.

Unit daADStanParam;


TADParam = class(TCollectionItem)
private
...
....
property AsBCDs[AIndex: Integer]: Currency read GetAsBCDs write SetAsBCDs;
property AsFMTBCDs[AIndex: Integer]: TBcd read GetAsFMTBCDs write SetAsFMTBCDs;


Why is AsBCDs of type Currency? I expected TBcd here.
As a workaroud I used AsFMTBCDs to work with TBCDs and it Seemd ok for the first 985records.
Is this a good Idea? I'm still having a Exception during batch Exec.

regards Dirk


RE: "Numeric Value Out Of Range"
Posted: 2005/08/11 14:51
 
Hello Dirk !

> Why is AsBCDs of type Currency?
Just for compatibility with standard TParam class.

> Is this a good Idea?
Yes, it is.

Regards,
Dmitry