Subject Re: [IBO] Sub-Selects and calculated fields
Author Helen Borrie (TeamIBO)
At 08:02 PM 18-02-02 +0100, Herbert Senner wrote:
>Hello all,
>I am facing a problem when dealing with a query that has (a)
>sub-select(s) (for lookups in details) and additionally
>declared calculated fields. (W2K, D6P, FB 6.2.679, IBO 4.2.Fr)
>If I want to post such queries after editing, inserting or deleting
>an errormessage is raised that the key in the subquery cannot be found.
>Nevertheless subsequently the dataset is posted and the changed
>values in the row are stored in the table and displayed correctly.

A bug is causing this problem. On Feb 12 Geoff Worboys posted this:
There is still a bug in IBO4.2.Fr (arrived in IBO4.2.Fp)...

In IB_Dataset.IMP...

procedure TIB_Dataset.KeyToChildAction( AAction: TIB_KeyChildAction;
Info: longint );
//TIB_Row( Info ).Values[ tmpVals ] :=
// TIB_BDataset( ADataset ).Lookup(
// tmpKeyVals,
// TIB_Row( Info ).Values[ tmpKeyFlds ], tmpFlds );
TIB_Row( Info ).Values[ tmpVals ] :=
TIB_BDataset( ADataset ).Lookup(
TIB_Row( Info ).Values[ tmpKeyVals ], tmpFlds );

It is just that the tmpKeyFlds and tmpKeyVals were reversed in the
call the Lookup.

>Is there another way to avoid this message than not
>to use calculated fields in queries with sub-selects?

If you have the source, you could fix it yourself. If not, and it is a showstopper, you could revert to 4.2Fn until Jason returns and can fix up the source and eval packs.

If you can't wait, contact me privately.

Helen Borrie (TeamIBO Support)

** Please don't email your support questions privately **
Ask on the list and everyone benefits
Don't forget the IB Objects online FAQ - link from any page at