Question: When using the TpFIBDataSet, I do not seem to find a way to handle INT64 types. Help please.

Field "PROD_UNIT_PRICE" in Firebird = BigInt     =  2,200,000,000

Delphi
pFIBDSDetail=TpFIBDataSet

var
mfact:int64;
...
case pfibqreport.fieldbyname('TBL_Type').AsInteger of
4: mfact:=pFIBDSDetail.fieldbyname('PROD_UNIT_PRICE').AsInteger

my result=
pFIBDSDetail.fieldbyname('PROD_UNIT_PRICE').AsInteger comes through as -2094967296

There is not
pFIBDSDetail.fieldbyname('PROD_UNIT_PRICE').asint64


How do I pass an Int64 through a TpFIBDataSet?


Answer:
Method "Fieldbyname" returns abstract class "TField". This class haven't methods for work with Int64 values.

pFIBDataSet has the psUseLargeIntField option in PrepareOptions. If
you include it into your code then FB Bigint field will do mapping
to TFIBLargeIntField. In this case you must write your code as:
4: mfact:=TFIBLargeIntField( pFIBDSDetail.fieldbyname('PROD_UNIT_PRICE')).AsLargeInt

If you don't include psUseLargeIntField then this field will do mapping to TFIBBCDField.

In this case you should write your code as:
4: mfact:=TFIBBCDField( pFIBDSDetail.fieldbyname('PROD_UNIT_PRICE')).AsInt64

And the last recommendation... If you can't know about prepareOptions in your code then you can write it as:
4:
  if pFIBDSDetail.fieldbyname('PROD_UNIT_PRICE') is  TFIBBCDField then
    mfact:=TFIBBCDField( pFIBDSDetail.fieldbyname('PROD_UNIT_PRICE')).AsInt64
  else
  mfact:=TFIBLargeIntField( pFIBDSDetail.fieldbyname('PROD_UNIT_PRICE')).AsLargeInt


Preview text: 
Prices in Euro:

235 (1 copy)
1250 (unlimited)

Volume discounts are available...

Navigation



During a re-write of a very large software system we were having some difficulties utilizing a 3rd party grid that we had chosen. The dataset connectivity was very flaky due to the complex joins and updates we were using which caused the grids to behave very sketchy.  FIBPlus was the perfect solution for us. After implementing it everything became so much easier. The grid functionality stabilized, data retrieval was much faster, and we were pleasantly surprised by many of the unique features of your components. We were especially impressed with your pFIBUpdateObject components which allowed us to very easily update the multiple tables we were using in our joins.  Many thanks for your great components.

>>

Tracy Anderson, Team Leader, EDSS Division of AADG, Inc.
FOR CUSTOMERS
Download full versions and updates in your Personal Area