Subject Re: [IBO] invalid database key
Author Helen Borrie
At 02:16 PM 06-07-01 +0000, you wrote:
>Thanks a lot. The field ADOSEN.SUMME is a "computed-by" field. After
>turning it into a normal numeric field everything's working fine. Is
>this a bug?


Not a bug - in InterBase you can't GROUP BY an expression for logical reasons involving the way intermediate datasets are formed. Columns which are defined as COMPUTED BY contain expressions, not static values.

If you know that you are going to need this column for grouping purposes, then define it as a static column and have it populated and updated by Before Insert and Before Update triggers.

It's worth suggesting that you avoid using NUMERIC(), timestamp or real types for groupings, anyway. They can make the groups so granular as to be useless, i.e. the output set comes out looking as if it wasn't grouped at all because the differences between these values can be so miniscule - but you still get all the performance overhead as the engine processes the intermediate output sets.

Regards,
Helen


All for Open and Open for All
InterBase Developer Initiative ยท http://www.interbase2000.org
_______________________________________________________