Subject Re: [ib-support] Expression evaluation not supported error - repost
Author Helen Borrie
At 08:17 AM 24-10-02 +0200, you wrote:
>Hello
>
>Sorry, I know that it isn't polite to repost my question, but I'm desparate
>a little bit.
>Could someone explain the reason of getting 'expression evaluation not
>supported' error when dealing with computed fields.
>Details below.

Can only guess, but...
> pz_numer COMPUTED BY ((CAST(NR||'/'||(EXTRACT(YEAR FROM DATA_PZ)) AS
VARCHAR(10))));


Shouldn't this be
pz_numer COMPUTED BY
CAST(NR as varchar(18)) || '/' ||CAST(EXTRACT(YEAR FROM DATA_PZ) AS CHAR(4)) ;

Actually, I wouldn't even use a computed column for this because of the
variability of the varchar part. I'd create a varchar column of suitable
size and maintain it with Before Insert and Before Update triggers. This
would also mean you could index it.

create trigger.. for ...
active before insert | update as
begin
new.pz_numer = CAST(new.NR as varchar(18)) || '/' ||CAST(EXTRACT(YEAR
FROM new.DATA_PZ) AS CHAR(4));
end

This looks suspect too:

> > , cast(count(R.kod_8) as integer) as ile

I think it it is invalid to try to cast an integer as an integer. Should be

, count(R.kod_8) as ile

hth

heLen