Subject Re: [IBO] Slow Posting becouse of calculated fields
Author Burak OZLER
CalculateAllFields already set to True;

----- Original Message -----
From: "Geoff Worboys" <geoff@...>
To: "Burak OZLER" <IBObjects@yahoogroups.com>
Sent: Wednesday, December 26, 2001 1:52 AM
Subject: Re: [IBO] Slow Posting becouse of calculated fields


> > Happy Christmas to everyone & Loves from Turkey...
>
> And to you.
>
>
> > My table includes 5 calculated field and I have this function
> ...
> > what I don't under stand is why TIB_Query runs this function 14
> > times when posting, any reason? any solution? are welcome
>
> By default TIB_Query calls OnCalculateField once for each calculated
> field in the dataset. Each call comes with the AField parameter set to
> the particular calculated column instance. The usual arrangement in
> OnCalculateField then becomes something like...
>
> with AField do
> if FieldName = 'STYLE' then
> <do the calculation>
>
>
> The result of this is that your function (with 5 calculated fields)
> will be called 5 times for every row. In my brief experiment here I
> found that posting resulted in two lots of calculatingfields being
> done (I did not check but this is presumably one just before posting
> and one on the refresh of the row after post).
>
> There is a recently introduced property on TIB_Query called
> CalculateAllFields, when this is set to true then OnCalculateField is
> only called once per requirement, with the AField parameter set to
> nil. In this instance the function would be setup as you have it, to
> calculate all calculated fields in a single call.
>
> hth
>
> --
> Geoff Worboys
> Telesis Computing
>
>
>
>
___________________________________________________________________________
> IB Objects - direct, complete, custom connectivity to Firebird or
InterBase
> without the need for BDE, ODBC or any other layer.
>
___________________________________________________________________________
> http://www.ibobjects.com - your IBO community resource for Tech Info
papers,
> keyword-searchable FAQ, community code contributions and more !
>
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
>
>