Accessing Numeric as Int64

Discussion of open issues, suggestions and bugs regarding UniDAC (Universal Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
Tsagoth
Posts: 33
Joined: Wed 15 Jul 2009 01:25

Accessing Numeric as Int64

Post by Tsagoth » Mon 28 Jan 2013 16:28

IB stores large NUMERIC values as int64. How to access these fields with TUniQuery ? There is no .AsInt64 method for FieldByName and casting it as TLargeIntField(Fieldbyname).AsLargeint just returns a zero value. Trunc(Fieldbyname.AsFloat) works but that doesn't seem like the proper way to do it.

AndreyZ

Re: Accessing Numeric as Int64

Post by AndreyZ » Tue 29 Jan 2013 11:13

InterBase stores NUMERIC fields as Int64 for performance reasons, actual values are Double. UniDAC maps NUMERIC fields as TFloatField, so to work with these fields, you should use the AsFloat property. If you want to obtain the Int64 representation of Double values, you should perform the conversion yourself.

Post Reply